summaryrefslogtreecommitdiffstats
path: root/Tests/StringFileTest
diff options
context:
space:
mode:
authorAndy Cedilnik <andy.cedilnik@kitware.com>2005-10-17 13:10:20 (GMT)
committerAndy Cedilnik <andy.cedilnik@kitware.com>2005-10-17 13:10:20 (GMT)
commit6e5cdd6de72de0d9d8f91c9971f0c13e10511c73 (patch)
tree03b8912732fb9070de978fc883cfb8e70ade305d /Tests/StringFileTest
parent33ac18891ff73863b088ca3f373eb90620637c11 (diff)
downloadCMake-6e5cdd6de72de0d9d8f91c9971f0c13e10511c73.zip
CMake-6e5cdd6de72de0d9d8f91c9971f0c13e10511c73.tar.gz
CMake-6e5cdd6de72de0d9d8f91c9971f0c13e10511c73.tar.bz2
ENH: Add regular string replace (not regex), and relative path command. Also add tests
Diffstat (limited to 'Tests/StringFileTest')
-rw-r--r--Tests/StringFileTest/CMakeLists.txt5
-rw-r--r--Tests/StringFileTest/StringFile.cxx2
2 files changed, 7 insertions, 0 deletions
diff --git a/Tests/StringFileTest/CMakeLists.txt b/Tests/StringFileTest/CMakeLists.txt
index 298f694..373e811 100644
--- a/Tests/StringFileTest/CMakeLists.txt
+++ b/Tests/StringFileTest/CMakeLists.txt
@@ -20,6 +20,9 @@ STRING(COMPARE GREATER "max" "min" ncgvar)
STRING(ASCII 67 109 97 107 101 savar)
STRING(TOUPPER "CMake" tuvar)
STRING(TOLOWER "CMake" tlvar)
+STRING(REPLACE "Autoconf" "CMake" repvar "People should use Autoconf")
+
+FILE(RELATIVE_PATH relpath "/usr/local/bin" "/usr/X11R6/bin/xnest")
# Escaping test
SET(var "\\ \" \ \t \n \r \# \( \) \0")
@@ -49,6 +52,8 @@ FOREACH(var
rmvar
rmallvar
rrepvar
+ repvar
+ relpath
nceqvar
ceqvar
cneqvar
diff --git a/Tests/StringFileTest/StringFile.cxx b/Tests/StringFileTest/StringFile.cxx
index bc2312b..67d7c5f 100644
--- a/Tests/StringFileTest/StringFile.cxx
+++ b/Tests/StringFileTest/StringFile.cxx
@@ -9,6 +9,7 @@ int main(int, char*[])
res += CheckMethod(rmvar, "CMake");
res += CheckMethod(rmallvar, "CMake;cmake;CMake");
res += CheckMethod(rrepvar, "People should use CMake and CMake");
+ res += CheckMethod(repvar, "People should use CMake");
res += CheckMethod(nceqvar, "0");
res += CheckMethod(ceqvar, "1");
res += CheckMethod(cneqvar, "1");
@@ -20,6 +21,7 @@ int main(int, char*[])
res += CheckMethod(savar, "Cmake");
res += CheckMethod(tuvar, "CMAKE");
res += CheckMethod(tlvar, "cmake");
+ res += CheckMethod(relpath, "../../X11R6/bin/xnest");
return res;
}