CMake/Tests/RunCMake/GenEx-LIST/CMP0186-OLD-check.cmake
Nikita Nemkin 5d039f3be3 regex: Match ^ at most once in repeated searches
When doing successive matches, track the input start and current search
start positions separately to prevent the `^` anchor from matching in
the middle of the string.  Add policy CMP0186 to provide compatibility.

Issue: #26629
Fixes: #16899
2025-02-13 20:00:02 +05:00

12 lines
247 B
CMake

set(expected "
;1001;2
xxxx;1001;xxx2
xxxx;xx1;xxx2
")
file(READ "${RunCMake_TEST_BINARY_DIR}/generated.txt" generated)
if(NOT generated STREQUAL expected)
set(RunCMake_TEST_FAILED "generated:${generated}\nexpected:${expected}")
endif()