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