summaryrefslogtreecommitdiff
path: root/Tests/RunCMake/GenEx-LIST/REMOVE_AT.cmake.in
blob: 42a94766f990824cae1fa940478775085d3ef46d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25

include ("${RunCMake_SOURCE_DIR}/check_errors.cmake")
unset (errors)

set(listvar a b c d)
list(REMOVE_AT listvar 1 3)
set (output "$<LIST:REMOVE_AT,a;b;c;d,1,3>")
if (NOT output STREQUAL listvar)
  list (APPEND errors "returns bad value: ${output}")
endif()

set(listvar a b c d)
list(REMOVE_AT listvar 1 -2)
set (output "$<LIST:REMOVE_AT,a;b;c;d,1;-2>")
if (NOT output STREQUAL listvar)
  list (APPEND errors "returns bad value: ${output}")
endif()

set (output "$<LIST:REMOVE_AT,a;b;c;d,1,0,3;2>")
if (NOT output STREQUAL "")
  list (APPEND errors "returns bad value: ${output}")
endif()


check_errors("LIST:REMOVE_AT..." ${errors})