summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Tests/StringFileTest/CMakeLists.txt33
1 files changed, 33 insertions, 0 deletions
diff --git a/Tests/StringFileTest/CMakeLists.txt b/Tests/StringFileTest/CMakeLists.txt
index 36d15ce..9768947 100644
--- a/Tests/StringFileTest/CMakeLists.txt
+++ b/Tests/StringFileTest/CMakeLists.txt
@@ -56,6 +56,39 @@ STRING(TOUPPER "CMake" tuvar)
STRING(TOLOWER "CMake" tlvar)
STRING(REPLACE "Autoconf" "CMake" repvar "People should use Autoconf")
+IF("abc" STREQUAL "xyz")
+ MESSAGE(SEND_ERROR "Problem with the IF(STREQUAL), \"abc\" and \"xyz\" considered equal")
+ENDIF("abc" STREQUAL "xyz")
+
+IF("CMake is cool" MATCHES "(CMake) (is).+")
+ IF(NOT "${CMAKE_MATCH_0}" STREQUAL "CMake is cool")
+ MESSAGE(SEND_ERROR "CMAKE_MATCH_0 wrong: \"${CMAKE_MATCH_0}\", expected \"CMake is cool\"")
+ ENDIF(NOT "${CMAKE_MATCH_0}" STREQUAL "CMake is cool")
+ IF(NOT "${CMAKE_MATCH_1}" STREQUAL "CMake")
+ MESSAGE(SEND_ERROR "CMAKE_MATCH_1 wrong: \"${CMAKE_MATCH_1}\", expected \"CMake\"")
+ ENDIF(NOT "${CMAKE_MATCH_1}" STREQUAL "CMake")
+ IF(NOT "${CMAKE_MATCH_2}" STREQUAL "is")
+ MESSAGE(SEND_ERROR "CMAKE_MATCH_2 wrong: \"${CMAKE_MATCH_2}\", expected \"is\"")
+ ENDIF(NOT "${CMAKE_MATCH_2}" STREQUAL "is")
+ELSE("CMake is cool" MATCHES "(CMake) (is).+")
+ MESSAGE(SEND_ERROR "Problem with the IF(MATCHES), no match found")
+ENDIF("CMake is cool" MATCHES "(CMake) (is).+")
+
+STRING(REGEX MATCH "(People).+CMake" matchResultVar "People should use CMake")
+IF(NOT "${matchResultVar}" STREQUAL "People should use CMake")
+ MESSAGE(SEND_ERROR "STRING(REGEX MATCH) problem: \"${matchResultVar}\", expected \"People should use CMake\"")
+ENDIF(NOT "${matchResultVar}" STREQUAL "People should use CMake")
+IF(NOT "${CMAKE_MATCH_0}" STREQUAL "People should use CMake")
+ MESSAGE(SEND_ERROR "CMAKE_MATCH_0 wrong: \"${CMAKE_MATCH_0}\", expected \"People should use CMake\"")
+ENDIF(NOT "${CMAKE_MATCH_0}" STREQUAL "People should use CMake")
+IF(NOT "${CMAKE_MATCH_1}" STREQUAL "People")
+ MESSAGE(SEND_ERROR "CMAKE_MATCH_1 wrong: \"${CMAKE_MATCH_1}\", expected \"People\"")
+ENDIF(NOT "${CMAKE_MATCH_1}" STREQUAL "People")
+IF(NOT "${CMAKE_MATCH_2}" STREQUAL "")
+ MESSAGE(SEND_ERROR "CMAKE_MATCH_2 wrong: \"${CMAKE_MATCH_2}\", expected empty string")
+ENDIF(NOT "${CMAKE_MATCH_2}" STREQUAL "")
+
+
STRING(STRIP "
ST1
" ST1)