summaryrefslogtreecommitdiffstats
path: root/Tests
diff options
context:
space:
mode:
authorKyle Edwards <kyle.edwards@kitware.com>2019-02-27 16:22:57 (GMT)
committerKyle Edwards <kyle.edwards@kitware.com>2019-02-27 16:22:57 (GMT)
commit258298f59799311ad6a3f261f7e7bebcaf346657 (patch)
tree454342de51403b5c138d809e0b608109bbcc392a /Tests
parentb13a8441cd1338ac9f8352a4df54759a1b19088a (diff)
downloadCMake-258298f59799311ad6a3f261f7e7bebcaf346657.zip
CMake-258298f59799311ad6a3f261f7e7bebcaf346657.tar.gz
CMake-258298f59799311ad6a3f261f7e7bebcaf346657.tar.bz2
Help: Clarify ordering of list(REMOVE_DUPLICATES)
This also adds a test to enforce the order behavior of list(REMOVE_DUPLICATES).
Diffstat (limited to 'Tests')
-rw-r--r--Tests/RunCMake/list/REMOVE_DUPLICATES-PreserveOrder.cmake5
-rw-r--r--Tests/RunCMake/list/RunCMakeTest.cmake2
2 files changed, 7 insertions, 0 deletions
diff --git a/Tests/RunCMake/list/REMOVE_DUPLICATES-PreserveOrder.cmake b/Tests/RunCMake/list/REMOVE_DUPLICATES-PreserveOrder.cmake
new file mode 100644
index 0000000..91abbd6
--- /dev/null
+++ b/Tests/RunCMake/list/REMOVE_DUPLICATES-PreserveOrder.cmake
@@ -0,0 +1,5 @@
+set(mylist "b;c;b;a;a;c;b;a;c;b")
+list(REMOVE_DUPLICATES mylist)
+if(NOT mylist STREQUAL "b;c;a")
+ message(SEND_ERROR "Expected b;c;a, got ${mylist}")
+endif()
diff --git a/Tests/RunCMake/list/RunCMakeTest.cmake b/Tests/RunCMake/list/RunCMakeTest.cmake
index 59c7ea5..b4a91bc 100644
--- a/Tests/RunCMake/list/RunCMakeTest.cmake
+++ b/Tests/RunCMake/list/RunCMakeTest.cmake
@@ -24,6 +24,8 @@ run_cmake(SUBLIST-TooManyArguments)
run_cmake(REMOVE_AT-EmptyList)
+run_cmake(REMOVE_DUPLICATES-PreserveOrder)
+
run_cmake(FILTER-NotList)
run_cmake(REMOVE_AT-NotList)
run_cmake(REMOVE_DUPLICATES-NotList)