summaryrefslogtreecommitdiff
path: root/Tests/RunCMake/GenEx-LIST/INSERT.cmake.in
blob: d3bb9b9b188810563f51d268035a77f19f774a98 (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
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
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})