summaryrefslogtreecommitdiff
path: root/tests/stringmatch.test
diff options
context:
space:
mode:
Diffstat (limited to 'tests/stringmatch.test')
-rw-r--r--tests/stringmatch.test56
1 files changed, 23 insertions, 33 deletions
diff --git a/tests/stringmatch.test b/tests/stringmatch.test
index b964ed4..dcb0586 100644
--- a/tests/stringmatch.test
+++ b/tests/stringmatch.test
@@ -9,7 +9,7 @@
#
# RCS: @(#) $Id: util.test,v 1.7.2.1 2001/07/16 23:14:13 hobbs Exp $
-source testing.tcl
+source [file dirname [info script]]/testing.tcl
test stringmatch-5.1 {Tcl_StringMatch} {
string match ab*c abc
@@ -35,13 +35,11 @@ test stringmatch-5.7 {Tcl_StringMatch: UTF-8} {
test stringmatch-5.8 {Tcl_StringMatch} {
string match a?c abc
} 1
-ifutf8 {
- test stringmatch-5.9 {Tcl_StringMatch: UTF-8} {
- # skip one character in string
+test stringmatch-5.9 {Tcl_StringMatch: UTF-8} utf8 {
+ # skip one character in string
- string match a?c a\u4e4fc
- } 1
-}
+ string match a?c a\u4e4fc
+} 1
test stringmatch-5.10 {Tcl_StringMatch} {
string match a??c abc
} 0
@@ -51,13 +49,11 @@ test stringmatch-5.11 {Tcl_StringMatch} {
test stringmatch-5.12 {Tcl_StringMatch} {
string match {[abc]bc} abc
} 1
-ifutf8 {
- test stringmatch-5.13 {Tcl_StringMatch: UTF-8} {
- # string += Tcl_UtfToUniChar(string, &ch);
+test stringmatch-5.13 {Tcl_StringMatch: UTF-8} utf8 {
+ # string += Tcl_UtfToUniChar(string, &ch);
- string match "\[\u4e4fxy\]bc" "\u4e4fbc"
- } 1
-}
+ string match "\[\u4e4fxy\]bc" "\u4e4fbc"
+} 1
test stringmatch-5.14 {Tcl_StringMatch} {
# if ((*pattern == ']') || (*pattern == '\0'))
# badly formed pattern
@@ -73,14 +69,12 @@ test stringmatch-5.15 {Tcl_StringMatch} {
test stringmatch-5.16 {Tcl_StringMatch} {
string match {a[abc]c} abc
} 1
-ifutf8 {
- test stringmatch-5.17 {Tcl_StringMatch: UTF-8} {
- # pattern += Tcl_UtfToUniChar(pattern, &endChar);
- # get 1 UTF-8 character
+test stringmatch-5.17 {Tcl_StringMatch: UTF-8} utf8 {
+ # pattern += Tcl_UtfToUniChar(pattern, &endChar);
+ # get 1 UTF-8 character
- string match "a\[a\u4e4fc]c" "a\u4e4fc"
- } 1
-}
+ string match "a\[a\u4e4fc]c" "a\u4e4fc"
+} 1
test stringmatch-5.18 {Tcl_StringMatch: UTF-8} {
# pattern += Tcl_UtfToUniChar(pattern, &endChar);
# proper advance: wrong answer would match on UTF trail byte of \u4e4f
@@ -102,14 +96,12 @@ test stringmatch-5.21 {Tcl_StringMatch} {
test stringmatch-5.22 {Tcl_StringMatch: UTF-8 range} {
string match "\[\u4e00-\u4e4f]" "0"
} 0
-ifutf8 {
- test stringmatch-5.23 {Tcl_StringMatch: UTF-8 range} {
- string match "\[\u4e00-\u4e4f]" "\u4e33"
- } 1
- test stringmatch-5.24 {Tcl_StringMatch: UTF-8 range} {
- string match "\[\u4e00-\u4e4f]" "\uff08"
- } 0
-}
+test stringmatch-5.23 {Tcl_StringMatch: UTF-8 range} utf8 {
+ string match "\[\u4e00-\u4e4f]" "\u4e33"
+} 1
+test stringmatch-5.24 {Tcl_StringMatch: UTF-8 range} utf8 {
+ string match "\[\u4e00-\u4e4f]" "\uff08"
+} 0
test stringmatch-5.25 {Tcl_StringMatch} {
string match {12[ab2-4cd]45} 12345
} 1
@@ -164,11 +156,9 @@ test stringmatch-5.41 {Tcl_StringMatch: skip correct number of ']'} {
test stringmatch-5.42 {Tcl_StringMatch: skip correct number of ']'} {
string match {[A-]]x} \ue1x
} 0
-ifutf8 {
- test stringmatch-5.43 {Tcl_StringMatch: skip correct number of ']'} {
- string match \[A-]\ue1]x \ue1x
- } 1
-}
+test stringmatch-5.43 {Tcl_StringMatch: skip correct number of ']'} utf8 {
+ string match \[A-]\ue1]x \ue1x
+} 1
test stringmatch-5.44 {Tcl_StringMatch: skip correct number of ']'} {
string match {[A-]h]x} hx
} 1