summaryrefslogtreecommitdiff
path: root/Tests/ComplexOneConfig/CMakeLists.txt
diff options
context:
space:
mode:
Diffstat (limited to 'Tests/ComplexOneConfig/CMakeLists.txt')
-rw-r--r--Tests/ComplexOneConfig/CMakeLists.txt17
1 files changed, 17 insertions, 0 deletions
diff --git a/Tests/ComplexOneConfig/CMakeLists.txt b/Tests/ComplexOneConfig/CMakeLists.txt
index bcc56a53ec..aa4bb4b438 100644
--- a/Tests/ComplexOneConfig/CMakeLists.txt
+++ b/Tests/ComplexOneConfig/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
#