diff options
author | Brad King <brad.king@kitware.com> | 2002-11-06 23:05:39 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2002-11-06 23:05:39 (GMT) |
commit | 6ab16695d066278fe9f78774ec3df3733d932c06 (patch) | |
tree | efe7ecb05c7418013618a8d36577dd41c4d02815 /Tests | |
parent | 42c464c05e8f79f82babf83909d918bf26317425 (diff) | |
download | CMake-6ab16695d066278fe9f78774ec3df3733d932c06.zip CMake-6ab16695d066278fe9f78774ec3df3733d932c06.tar.gz CMake-6ab16695d066278fe9f78774ec3df3733d932c06.tar.bz2 |
BUG: Fixed STRING(REGEX REPLACE ...) and added better test.
Diffstat (limited to 'Tests')
-rw-r--r-- | Tests/Complex/CMakeLists.txt | 9 | ||||
-rw-r--r-- | Tests/ComplexOneConfig/CMakeLists.txt | 9 | ||||
-rw-r--r-- | Tests/ComplexRelativePaths/CMakeLists.txt | 9 |
3 files changed, 15 insertions, 12 deletions
diff --git a/Tests/Complex/CMakeLists.txt b/Tests/Complex/CMakeLists.txt index aa4bb4b..af0c5d1 100644 --- a/Tests/Complex/CMakeLists.txt +++ b/Tests/Complex/CMakeLists.txt @@ -221,12 +221,13 @@ STRING(REGEX MATCHALL "b" RESULT "abcb") IF(NOT RESULT) MESSAGE(SEND_ERROR "STRING(REGEX MATCHALL ... ) test failed.") ENDIF(NOT RESULT) -STRING(REGEX REPLACE "(b)" "[\\1]" RESULT "abcde") -IF("x${RESULT}" MATCHES "^xa\\[b\\]cde$") +STRING(REGEX REPLACE ".([bd])." "[\\1]" RESULT "a(b)c(d)e") +IF("x${RESULT}" MATCHES "^xa\\[b\\]c\\[d\\]e$") SET(STRING_REGEX_PASSED 1) -ENDIF("x${RESULT}" MATCHES "^xa\\[b\\]cde$") +ENDIF("x${RESULT}" MATCHES "^xa\\[b\\]c\\[d\\]e$") IF(NOT STRING_REGEX_PASSED) - MESSAGE(SEND_ERROR "STRING(REGEX REPLACE ... ) test failed.") + MESSAGE(SEND_ERROR + "STRING(REGEX REPLACE ... ) test failed (\"${RESULT}\" v. \"a[b]c[d]e\")") ENDIF(NOT STRING_REGEX_PASSED) # diff --git a/Tests/ComplexOneConfig/CMakeLists.txt b/Tests/ComplexOneConfig/CMakeLists.txt index aa4bb4b..af0c5d1 100644 --- a/Tests/ComplexOneConfig/CMakeLists.txt +++ b/Tests/ComplexOneConfig/CMakeLists.txt @@ -221,12 +221,13 @@ STRING(REGEX MATCHALL "b" RESULT "abcb") IF(NOT RESULT) MESSAGE(SEND_ERROR "STRING(REGEX MATCHALL ... ) test failed.") ENDIF(NOT RESULT) -STRING(REGEX REPLACE "(b)" "[\\1]" RESULT "abcde") -IF("x${RESULT}" MATCHES "^xa\\[b\\]cde$") +STRING(REGEX REPLACE ".([bd])." "[\\1]" RESULT "a(b)c(d)e") +IF("x${RESULT}" MATCHES "^xa\\[b\\]c\\[d\\]e$") SET(STRING_REGEX_PASSED 1) -ENDIF("x${RESULT}" MATCHES "^xa\\[b\\]cde$") +ENDIF("x${RESULT}" MATCHES "^xa\\[b\\]c\\[d\\]e$") IF(NOT STRING_REGEX_PASSED) - MESSAGE(SEND_ERROR "STRING(REGEX REPLACE ... ) test failed.") + MESSAGE(SEND_ERROR + "STRING(REGEX REPLACE ... ) test failed (\"${RESULT}\" v. \"a[b]c[d]e\")") ENDIF(NOT STRING_REGEX_PASSED) # diff --git a/Tests/ComplexRelativePaths/CMakeLists.txt b/Tests/ComplexRelativePaths/CMakeLists.txt index aa4bb4b..af0c5d1 100644 --- a/Tests/ComplexRelativePaths/CMakeLists.txt +++ b/Tests/ComplexRelativePaths/CMakeLists.txt @@ -221,12 +221,13 @@ STRING(REGEX MATCHALL "b" RESULT "abcb") IF(NOT RESULT) MESSAGE(SEND_ERROR "STRING(REGEX MATCHALL ... ) test failed.") ENDIF(NOT RESULT) -STRING(REGEX REPLACE "(b)" "[\\1]" RESULT "abcde") -IF("x${RESULT}" MATCHES "^xa\\[b\\]cde$") +STRING(REGEX REPLACE ".([bd])." "[\\1]" RESULT "a(b)c(d)e") +IF("x${RESULT}" MATCHES "^xa\\[b\\]c\\[d\\]e$") SET(STRING_REGEX_PASSED 1) -ENDIF("x${RESULT}" MATCHES "^xa\\[b\\]cde$") +ENDIF("x${RESULT}" MATCHES "^xa\\[b\\]c\\[d\\]e$") IF(NOT STRING_REGEX_PASSED) - MESSAGE(SEND_ERROR "STRING(REGEX REPLACE ... ) test failed.") + MESSAGE(SEND_ERROR + "STRING(REGEX REPLACE ... ) test failed (\"${RESULT}\" v. \"a[b]c[d]e\")") ENDIF(NOT STRING_REGEX_PASSED) # |