diff options
author | Asit Dhal <dhal.asitk@gmail.com> | 2021-01-07 06:30:00 (GMT) |
---|---|---|
committer | Asit Dhal <dhal.asitk@gmail.com> | 2021-01-12 07:27:40 (GMT) |
commit | 38e2299fc84aa31ca73bebf1efc9123dbc7bee1a (patch) | |
tree | 00d285e77ec9638cc43f7cbdbed884dad2e2c9e2 /Tests/RunCMake/list | |
parent | 4f5a12be2924ceedc41c2da632e30e332f000f37 (diff) | |
download | CMake-38e2299fc84aa31ca73bebf1efc9123dbc7bee1a.zip CMake-38e2299fc84aa31ca73bebf1efc9123dbc7bee1a.tar.gz CMake-38e2299fc84aa31ca73bebf1efc9123dbc7bee1a.tar.bz2 |
list(REMOVE_ITEM): Make removal of an empty item a no-op.
Fixes: #21663
Diffstat (limited to 'Tests/RunCMake/list')
-rw-r--r-- | Tests/RunCMake/list/REMOVE_ITEM-NoItemArg.cmake | 5 | ||||
-rw-r--r-- | Tests/RunCMake/list/RunCMakeTest.cmake | 1 |
2 files changed, 6 insertions, 0 deletions
diff --git a/Tests/RunCMake/list/REMOVE_ITEM-NoItemArg.cmake b/Tests/RunCMake/list/REMOVE_ITEM-NoItemArg.cmake new file mode 100644 index 0000000..f69c024 --- /dev/null +++ b/Tests/RunCMake/list/REMOVE_ITEM-NoItemArg.cmake @@ -0,0 +1,5 @@ +set(ls "a" "b" "c") +list(REMOVE_ITEM ls alpha) +if (NOT ls STREQUAL "a;b;c") + message(FATAL_ERROR "list(REMOVE_ITEM) modified for empty item") +endif () diff --git a/Tests/RunCMake/list/RunCMakeTest.cmake b/Tests/RunCMake/list/RunCMakeTest.cmake index b4a91bc..c11891c 100644 --- a/Tests/RunCMake/list/RunCMakeTest.cmake +++ b/Tests/RunCMake/list/RunCMakeTest.cmake @@ -30,6 +30,7 @@ run_cmake(FILTER-NotList) run_cmake(REMOVE_AT-NotList) run_cmake(REMOVE_DUPLICATES-NotList) run_cmake(REMOVE_ITEM-NotList) +run_cmake(REMOVE_ITEM-NoItemArg) run_cmake(REVERSE-NotList) run_cmake(SORT-NotList) |