diff options
Diffstat (limited to 'Tests/RunCMake/GenEx-LIST/INSERT.cmake.in')
-rw-r--r-- | Tests/RunCMake/GenEx-LIST/INSERT.cmake.in | 50 |
1 files changed, 50 insertions, 0 deletions
diff --git a/Tests/RunCMake/GenEx-LIST/INSERT.cmake.in b/Tests/RunCMake/GenEx-LIST/INSERT.cmake.in new file mode 100644 index 0000000..d3bb9b9 --- /dev/null +++ b/Tests/RunCMake/GenEx-LIST/INSERT.cmake.in @@ -0,0 +1,50 @@ + +include ("${RunCMake_SOURCE_DIR}/check_errors.cmake") +unset (errors) + +set(listvar a b c d) + +list(INSERT listvar 1 e) +set (output "$<LIST:INSERT,a;b;c;d,1,e>") +if (NOT output STREQUAL listvar) + list (APPEND errors "returns bad value: ${output}") +endif() + +set(listvar a b c d) + +list(INSERT listvar 2 e f) +set (output "$<LIST:INSERT,a;b;c;d,2,e,f>") +if (NOT output STREQUAL listvar) + list (APPEND errors "returns bad value: ${output}") +endif() + +set(listvar a b c d) +list(INSERT listvar 0 e f) +set (output "$<LIST:INSERT,a;b;c;d,0,e;f>") +if (NOT output STREQUAL listvar) + list (APPEND errors "returns bad value: ${output}") +endif() + +set(listvar a b c d) +list(INSERT listvar -2 e f) +set (output "$<LIST:INSERT,a;b;c;d,-2,e;f>") +if (NOT output STREQUAL listvar) + list (APPEND errors "returns bad value: ${output}") +endif() + +set(listvar a b c d) +list(INSERT listvar 3 e f) +set (output "$<LIST:INSERT,a;b;c;d,3,e;f>") +if (NOT output STREQUAL listvar) + list (APPEND errors "returns bad value: ${output}") +endif() + +unset(listvar) +list(INSERT listvar 0 e f) +set (output "$<LIST:INSERT,,0,e,f>") +if (NOT output STREQUAL listvar) + list (APPEND errors "returns bad value: ${output}") +endif() + + +check_errors("LIST:INSERT..." ${errors}) |