diff options
Diffstat (limited to 'Tests/Complex/CMakeLists.txt')
-rw-r--r-- | Tests/Complex/CMakeLists.txt | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/Tests/Complex/CMakeLists.txt b/Tests/Complex/CMakeLists.txt index bcc56a5..aa4bb4b 100644 --- a/Tests/Complex/CMakeLists.txt +++ b/Tests/Complex/CMakeLists.txt @@ -212,6 +212,23 @@ CONFIGURE_FILE( ${Complex_SOURCE_DIR}/cmTestConfigureEscape.h.in ${Complex_BINARY_DIR}/cmTestConfigureEscape.h ESCAPE_QUOTES) +# Test regular expression commands. +STRING(REGEX MATCH "b" RESULT "abc") +IF(NOT RESULT) + MESSAGE(SEND_ERROR "STRING(REGEX MATCH ... ) test failed.") +ENDIF(NOT RESULT) +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$") + SET(STRING_REGEX_PASSED 1) +ENDIF("x${RESULT}" MATCHES "^xa\\[b\\]cde$") +IF(NOT STRING_REGEX_PASSED) + MESSAGE(SEND_ERROR "STRING(REGEX REPLACE ... ) test failed.") +ENDIF(NOT STRING_REGEX_PASSED) + # # Create the libs and the main exe # |