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