You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

33 lines
846 B

include ("${RunCMake_SOURCE_DIR}/check_errors.cmake")
unset (errors)
set(listvar a b c d)
list(SUBLIST listvar 1 2 reference)
set (output "$<LIST:SUBLIST,a;b;c;d,1,2>")
if (NOT output STREQUAL reference)
list (APPEND errors "returns bad value: ${output}")
endif()
list(SUBLIST listvar 1 -1 reference)
set (output "$<LIST:SUBLIST,a;b;c;d,1,-1>")
if (NOT output STREQUAL reference)
list (APPEND errors "returns bad value: ${output}")
endif()
list(SUBLIST listvar 1 0 reference)
set (output "$<LIST:SUBLIST,a;b;c;d,1,0>")
if (NOT output STREQUAL reference)
list (APPEND errors "returns bad value: ${output}")
endif()
list(SUBLIST listvar 1 5 reference)
set (output "$<LIST:SUBLIST,a;b;c;d,1,5>")
if (NOT output STREQUAL reference)
list (APPEND errors "returns bad value: ${output}")
endif()
check_errors("LIST:SUBLIST..." ${errors})