summaryrefslogtreecommitdiffstats
path: root/Tests/RunCMake/cmake_path/HASH.cmake
diff options
context:
space:
mode:
Diffstat (limited to 'Tests/RunCMake/cmake_path/HASH.cmake')
-rw-r--r--Tests/RunCMake/cmake_path/HASH.cmake27
1 files changed, 27 insertions, 0 deletions
diff --git a/Tests/RunCMake/cmake_path/HASH.cmake b/Tests/RunCMake/cmake_path/HASH.cmake
new file mode 100644
index 0000000..dfcf2b2
--- /dev/null
+++ b/Tests/RunCMake/cmake_path/HASH.cmake
@@ -0,0 +1,27 @@
+
+include ("${RunCMake_SOURCE_DIR}/check_errors.cmake")
+unset (errors)
+
+set (path1 "a///b/c")
+cmake_path(HASH path1 hash1)
+set (path2 "a/b////c")
+cmake_path(HASH path2 hash2)
+if (NOT hash1 STREQUAL hash2)
+ list (APPEND errors "'hash values not equal for '${path1}' and '${path2}'")
+endif()
+
+set (path1 "a///b/c/../d")
+cmake_path(HASH path1 hash1)
+set (path2 "a/b////d")
+cmake_path(HASH path2 hash2)
+if (hash1 STREQUAL hash2)
+ list (APPEND errors "'hash values equal for '${path1}' and '${path2}'")
+endif()
+cmake_path(HASH path1 hash1 NORMALIZE)
+cmake_path(HASH path2 NORMALIZE hash2)
+if (NOT hash1 STREQUAL hash2)
+ list (APPEND errors "'hash values not equal for '${path1}' and '${path2}'")
+endif()
+
+
+check_errors (HASH ${errors})