summaryrefslogtreecommitdiffstats
path: root/tests/string.test
diff options
context:
space:
mode:
authorjan.nijtmans <nijtmans@users.sourceforge.net>2022-05-24 19:44:28 (GMT)
committerjan.nijtmans <nijtmans@users.sourceforge.net>2022-05-24 19:44:28 (GMT)
commit0634c8ab5b34dd74bb49e8ae4c9ee0062063064e (patch)
treecb9187f6675b34bf731970faa31668e4923eeeae /tests/string.test
parent797ee36798bfc483ddad365b0947d55fcdac1365 (diff)
parentebd247f0bef013b7307aed2d223804205c9c5f70 (diff)
downloadtcl-0634c8ab5b34dd74bb49e8ae4c9ee0062063064e.zip
tcl-0634c8ab5b34dd74bb49e8ae4c9ee0062063064e.tar.gz
tcl-0634c8ab5b34dd74bb49e8ae4c9ee0062063064e.tar.bz2
Merge 8.6
Diffstat (limited to 'tests/string.test')
-rw-r--r--tests/string.test43
1 files changed, 21 insertions, 22 deletions
diff --git a/tests/string.test b/tests/string.test
index 6863c23..1a48d97 100644
--- a/tests/string.test
+++ b/tests/string.test
@@ -366,7 +366,6 @@ test string-3.42.$noComp {string equal, binary neq inequal length} {
run {string equal [binary format a20a 0 1] [binary format a100a 0 0]}
} 0
-
test string-4.1.$noComp {string first, not enough args} {
list [catch {run {string first a}} msg] $msg
} {1 {wrong # args: should be "string first needleString haystackString ?startIndex?"}}
@@ -425,22 +424,22 @@ test string-4.16.$noComp {string first, normal string vs pure unicode string} -b
} -match glob -result {{*string 1} {*string 0} 2}
test string-4.17.$noComp {string first, corner case} -body {
run {string first a aaa 4294967295}
-} -result {-1}
+} -result -1
test string-4.18.$noComp {string first, corner case} -body {
run {string first a aaa -1}
-} -result {0}
+} -result 0
test string-4.19.$noComp {string first, corner case} -body {
run {string first a aaa end-5}
-} -result {0}
+} -result 0
test string-4.20.$noComp {string last, corner case} -body {
run {string last a aaa 4294967295}
-} -result {2}
+} -result 2
test string-4.21.$noComp {string last, corner case} -body {
run {string last a aaa -1}
-} -result {-1}
+} -result -1
test string-4.22.$noComp {string last, corner case} {
run {string last a aaa end-5}
-} {-1}
+} -1
test string-5.1.$noComp {string index} {
list [catch {run {string index}} msg] $msg
@@ -1085,13 +1084,13 @@ test string-10.3.$noComp {string map, too many args} {
} {1 {wrong # args: should be "string map ?-nocase? charMap string"}}
test string-10.4.$noComp {string map} {
run {string map {a b} abba}
-} {bbbb}
+} bbbb
test string-10.5.$noComp {string map} {
run {string map {a b} a}
-} {b}
+} b
test string-10.6.$noComp {string map -nocase} {
run {string map -nocase {a b} Abba}
-} {bbbb}
+} bbbb
test string-10.7.$noComp {string map} {
run {string map {abc 321 ab * a A} aabcabaababcab}
} {A321*A*321*}
@@ -1106,7 +1105,7 @@ test string-10.10.$noComp {string map} {
} {1 {char map list unbalanced}}
test string-10.11.$noComp {string map, nulls} {
run {string map {\x00 NULL blah \x00nix} {qwerty}}
-} {qwerty}
+} qwerty
test string-10.12.$noComp {string map, unicode} {
run {string map [list ü ue UE Ü] "aüueUE\x00EU"}
} aueueÜ\x00EU
@@ -1118,13 +1117,13 @@ test string-10.14.$noComp {string map, -nocase null arguments} {
} foo
test string-10.15.$noComp {string map, one pair case} {
run {string map -nocase {abc 32} aAbCaBaAbAbcAb}
-} {a32aBaAb32Ab}
+} a32aBaAb32Ab
test string-10.16.$noComp {string map, one pair case} {
run {string map -nocase {ab 4321} aAbCaBaAbAbcAb}
-} {a4321C4321a43214321c4321}
+} a4321C4321a43214321c4321
test string-10.17.$noComp {string map, one pair case} {
run {string map {Ab 4321} aAbCaBaAbAbcAb}
-} {a4321CaBa43214321c4321}
+} a4321CaBa43214321c4321
test string-10.18.$noComp {string map, empty argument} {
run {string map -nocase {{} abc} foo}
} foo
@@ -1596,22 +1595,22 @@ test string-14.5.$noComp {string replace} {
} {abp}
test string-14.6.$noComp {string replace} -body {
run {string replace abcdefghijklmnop 7 1000}
-} -result {abcdefg}
+} -result abcdefg
test string-14.7.$noComp {string replace} {
run {string replace abcdefghijklmnop 10 end}
-} {abcdefghij}
+} abcdefghij
test string-14.8.$noComp {string replace} {
run {string replace abcdefghijklmnop 10 9}
-} {abcdefghijklmnop}
+} abcdefghijklmnop
test string-14.9.$noComp {string replace} {
run {string replace abcdefghijklmnop -3 2}
-} {defghijklmnop}
+} defghijklmnop
test string-14.10.$noComp {string replace} {
run {string replace abcdefghijklmnop -3 -2}
-} {abcdefghijklmnop}
+} abcdefghijklmnop
test string-14.11.$noComp {string replace} -body {
run {string replace abcdefghijklmnop 1000 1010}
-} -result {abcdefghijklmnop}
+} -result abcdefghijklmnop
test string-14.12.$noComp {string replace} {
run {string replace abcdefghijklmnop -100 end}
} {}
@@ -1858,7 +1857,7 @@ test string-20.5.$noComp {string trimright} {
test string-20.6.$noComp {string trimright, unicode default} {
run {string trimright ABC\u1361\x85\x00\xA0\u1680\u180E\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200A\u200B\u2028\u2029\u202F\u205F\u3000}
} ABC\u1361
-test string-20.7.$noComp {string trim on not valid utf-8 sequence (consider NTS as continuation char), bug [c61818e4c9]} {testbytestring} {
+test string-20.7.$noComp {string trim on not valid utf-8 sequence (consider NTS as continuation char), bug [c61818e4c9]} testbytestring {
set result {}
set a [testbytestring \xC0\x80\xA0]
set b foo$a
@@ -1871,7 +1870,7 @@ test string-20.7.$noComp {string trim on not valid utf-8 sequence (consider NTS
lappend result [string map $m [run {string trim $b fox}]]
lappend result [string map $m [run {string trim $b fo\x00}]]
} [list {*}[lrepeat 3 fooUV] {*}[lrepeat 2 UV V]]
-test string-20.8.$noComp {[c61818e4c9] [string trimright] fails when UtfPrev is ok} {testbytestring} {
+test string-20.8.$noComp {[c61818e4c9] [string trimright] fails when UtfPrev is ok} testbytestring {
set result {}
set a [testbytestring \xE8\xA0]
set b foo$a