summaryrefslogtreecommitdiffstats
path: root/Tests
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2023-06-20 13:25:28 (GMT)
committerKitware Robot <kwrobot@kitware.com>2023-06-20 13:25:40 (GMT)
commit8bfef726fa293f6853ad02101c9032cf68303378 (patch)
treee9c7d634ae18dfd0eb374246f5053cbd9d95abec /Tests
parentea1cd8ee7d476b461e442b6d5fcb81b4823ef0a6 (diff)
parent1cfaed0684e7e26687a3a0a607925456dc656c57 (diff)
downloadCMake-8bfef726fa293f6853ad02101c9032cf68303378.zip
CMake-8bfef726fa293f6853ad02101c9032cf68303378.tar.gz
CMake-8bfef726fa293f6853ad02101c9032cf68303378.tar.bz2
Merge topic 'cmList-SUBLIST-regression'
1cfaed0684 list(): restore SUBLIST behavior Acked-by: Kitware Robot <kwrobot@kitware.com> Tested-by: buildbot <buildbot@kitware.com> Merge-request: !8569
Diffstat (limited to 'Tests')
-rw-r--r--Tests/RunCMake/list/SUBLIST.cmake51
1 files changed, 51 insertions, 0 deletions
diff --git a/Tests/RunCMake/list/SUBLIST.cmake b/Tests/RunCMake/list/SUBLIST.cmake
index fd15c28..6a33add 100644
--- a/Tests/RunCMake/list/SUBLIST.cmake
+++ b/Tests/RunCMake/list/SUBLIST.cmake
@@ -44,3 +44,54 @@ list(SUBLIST mylist 1 -1 result)
if (NOT result STREQUAL "bravo;charlie;delta")
message (FATAL_ERROR "SUBLIST is \"${result}\", expected is \"bravo;charlie;delta\"")
endif()
+
+
+set(mylist ";;")
+
+unset(result)
+list(SUBLIST mylist 0 0 result)
+
+if (NOT result STREQUAL "")
+ message (FATAL_ERROR "SUBLIST is \"${result}\", expected is \"\"")
+endif()
+
+unset(result)
+list(SUBLIST mylist 0 1 result)
+
+if (NOT result STREQUAL "")
+ message (FATAL_ERROR "SUBLIST is \"${result}\", expected is \"\"")
+endif()
+
+unset(result)
+list(SUBLIST mylist 0 2 result)
+
+if (NOT result STREQUAL ";")
+ message (FATAL_ERROR "SUBLIST is \"${result}\", expected is \";\"")
+endif()
+
+unset(result)
+list(SUBLIST mylist 0 3 result)
+
+if (NOT result STREQUAL ";;")
+ message (FATAL_ERROR "SUBLIST is \"${result}\", expected is \";;\"")
+endif()
+
+
+set(mylist [[a\;b;c\;d;e]])
+
+unset(result)
+list(SUBLIST mylist 1 2 result)
+
+if (NOT result STREQUAL "c;d;e")
+ message (FATAL_ERROR "SUBLIST is \"${result}\", expected is \"c;d;e\"")
+endif()
+
+
+set(mylist [[a\;b;c\\;d;e;f;g;h]])
+
+unset(result)
+list(SUBLIST mylist 1 -1 result)
+
+if (NOT result STREQUAL "c\\;d;e;f;g;h")
+ message (FATAL_ERROR "SUBLIST is \"${result}\", expected is \"c\\;d;e;f;g;h\"")
+endif()