summaryrefslogtreecommitdiffstats
path: root/Tests/StringFileTest
diff options
context:
space:
mode:
authorAndy Cedilnik <andy.cedilnik@kitware.com>2005-10-17 13:56:42 (GMT)
committerAndy Cedilnik <andy.cedilnik@kitware.com>2005-10-17 13:56:42 (GMT)
commit12ef4edf64d2dd26cd03bd355b0f710b410f8d29 (patch)
tree97fa87a793899869df2c1915b6d2ea5c8f0e174c /Tests/StringFileTest
parent6e5cdd6de72de0d9d8f91c9971f0c13e10511c73 (diff)
downloadCMake-12ef4edf64d2dd26cd03bd355b0f710b410f8d29.zip
CMake-12ef4edf64d2dd26cd03bd355b0f710b410f8d29.tar.gz
CMake-12ef4edf64d2dd26cd03bd355b0f710b410f8d29.tar.bz2
ENH: Add String length and substring
Diffstat (limited to 'Tests/StringFileTest')
-rw-r--r--Tests/StringFileTest/CMakeLists.txt7
-rw-r--r--Tests/StringFileTest/StringFile.cxx2
2 files changed, 9 insertions, 0 deletions
diff --git a/Tests/StringFileTest/CMakeLists.txt b/Tests/StringFileTest/CMakeLists.txt
index 373e811..2cbc785 100644
--- a/Tests/StringFileTest/CMakeLists.txt
+++ b/Tests/StringFileTest/CMakeLists.txt
@@ -22,6 +22,11 @@ STRING(TOUPPER "CMake" tuvar)
STRING(TOLOWER "CMake" tlvar)
STRING(REPLACE "Autoconf" "CMake" repvar "People should use Autoconf")
+STRING(SUBSTRING "People should use Autoconf" 7 10 substringres)
+SET(substringres "Everybody ${substringres} CMake")
+
+STRING(LENGTH ${substringres} lengthres)
+
FILE(RELATIVE_PATH relpath "/usr/local/bin" "/usr/X11R6/bin/xnest")
# Escaping test
@@ -54,6 +59,8 @@ FOREACH(var
rrepvar
repvar
relpath
+ substringres
+ lengthres
nceqvar
ceqvar
cneqvar
diff --git a/Tests/StringFileTest/StringFile.cxx b/Tests/StringFileTest/StringFile.cxx
index 67d7c5f..0601aa0 100644
--- a/Tests/StringFileTest/StringFile.cxx
+++ b/Tests/StringFileTest/StringFile.cxx
@@ -10,7 +10,9 @@ int main(int, char*[])
res += CheckMethod(rmallvar, "CMake;cmake;CMake");
res += CheckMethod(rrepvar, "People should use CMake and CMake");
res += CheckMethod(repvar, "People should use CMake");
+ res += CheckMethod(substringres, "Everybody should use CMake");
res += CheckMethod(nceqvar, "0");
+ res += CheckMethod(lengthres, "26");
res += CheckMethod(ceqvar, "1");
res += CheckMethod(cneqvar, "1");
res += CheckMethod(ncneqvar, "0");