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

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

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

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

unset(listvar)
list(PREPEND listvar e f)
set (output "$<LIST:PREPEND,,e,f>")
if (NOT output STREQUAL listvar)
  list (PREPEND errors "returns bad value: ${output}")
endif()


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