summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorjan.nijtmans <nijtmans@users.sourceforge.net>2022-05-24 20:15:24 (GMT)
committerjan.nijtmans <nijtmans@users.sourceforge.net>2022-05-24 20:15:24 (GMT)
commit7e99b4ae118f949a902c308f5350a6b72be05f96 (patch)
tree2c443c5d33ebd6fede988c3c57e3ac2d0dbd766d /tests
parent089be89dd5b219a8d5156723b99478293c835f9a (diff)
parent0634c8ab5b34dd74bb49e8ae4c9ee0062063064e (diff)
downloadtcl-7e99b4ae118f949a902c308f5350a6b72be05f96.zip
tcl-7e99b4ae118f949a902c308f5350a6b72be05f96.tar.gz
tcl-7e99b4ae118f949a902c308f5350a6b72be05f96.tar.bz2
Merge 8.7
Diffstat (limited to 'tests')
-rw-r--r--tests/string.test59
-rw-r--r--tests/stringObj.test10
2 files changed, 34 insertions, 35 deletions
diff --git a/tests/string.test b/tests/string.test
index 70b0e0f..c4daad1 100644
--- a/tests/string.test
+++ b/tests/string.test
@@ -32,7 +32,7 @@ proc makeShared {s} {uplevel 1 [list lappend copy $s]; return $s}
testConstraint testobj [expr {[info commands testobj] ne {}}]
testConstraint testindexobj [expr {[info commands testindexobj] ne {}}]
testConstraint testevalex [expr {[info commands testevalex] ne {}}]
-testConstraint fullutf [expr {[string length \U010000] == 1}]
+testConstraint utf32 [expr {[string length \U010000] == 1}]
testConstraint testbytestring [llength [info commands testbytestring]]
# Used for constraining memory leak tests
@@ -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
} -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
@@ -501,13 +500,13 @@ test string-5.17.$noComp {string index, bad integer} -body {
test string-5.18.$noComp {string index, bad integer} -body {
list [catch {run {string index "abc" end-0o0289}} msg] $msg
} -match glob -result {1 {*}}
-test string-5.19.$noComp {string index, bytearray object out of bounds} -body {
+test string-5.19.$noComp {string index, bytearray object out of bounds} {
run {string index [binary format I* {0x50515253 0x52}] -1}
-} -result {}
+} {}
test string-5.20.$noComp {string index, bytearray object out of bounds} -body {
run {string index [binary format I* {0x50515253 0x52}] 20}
} -result {}
-test string-5.21.$noComp {string index, surrogates, bug [11ae2be95dac9417]} -constraints fullutf -body {
+test string-5.21.$noComp {string index, surrogates, bug [11ae2be95dac9417]} -constraints utf32 -body {
run {list [string index a\U100000b 1] [string index a\U100000b 2] [string index a\U100000b 3]}
} -result [list \U100000 b {}]
test string-5.22.$noComp {string index} -constraints testbytestring -body {
@@ -1072,13 +1071,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*}
@@ -1093,7 +1092,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
@@ -1105,13 +1104,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
@@ -1505,7 +1504,7 @@ test string-12.22.$noComp {string range, shimmering binary/index} {
binary scan $s a* x
run {string range $s $s end}
} 000000001
-test string-12.23.$noComp {string range, surrogates, bug [11ae2be95dac9417]} fullutf {
+test string-12.23.$noComp {string range, surrogates, bug [11ae2be95dac9417]} utf32 {
run {list [string range a\U100000b 1 1] [string range a\U100000b 2 2] [string range a\U100000b 3 3]}
} [list \U100000 b {}]
test string-12.24.$noComp {bignum index arithmetic} -setup {
@@ -1583,22 +1582,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}
} {}
@@ -1775,7 +1774,7 @@ test string-17.7.$noComp {string totitle, unicode} {
test string-17.8.$noComp {string totitle, compiled} {
lindex [run {string totitle [list aa bb [list cc]]}] 0
} Aa
-test string-17.9.$noComp {string totitle, surrogates, bug [11ae2be95dac9417]} fullutf {
+test string-17.9.$noComp {string totitle, surrogates, bug [11ae2be95dac9417]} utf32 {
run {list [string totitle a\U118c0c 1 1] [string totitle a\U118c0c 2 2] \
[string totitle a\U118c0c 3 3]}
} [list a\U118a0c a\U118c0C a\U118c0c]
@@ -1845,7 +1844,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
@@ -1858,7 +1857,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
@@ -1919,7 +1918,7 @@ test string-21.14.$noComp {string wordend, unicode} -body {
test string-21.15.$noComp {string wordend, unicode} -body {
run {string wordend "\U1D7CA\U1D7CA abc" 0}
} -result 2
-test string-21.16.$noComp {string wordend, unicode} -constraints fullutf -body {
+test string-21.16.$noComp {string wordend, unicode} -constraints utf32 -body {
run {string wordend "\U1D7CA\U1D7CA abc" 10}
} -result 6
test string-21.17.$noComp {string trim, unicode} {
@@ -1997,7 +1996,7 @@ test string-22.14.$noComp {string wordstart, invalid UTF-8} -constraints testbyt
test string-22.15.$noComp {string wordstart, unicode} -body {
run {string wordstart "\U1D7CA\U1D7CA abc" 0}
} -result 0
-test string-22.16.$noComp {string wordstart, unicode} -constraints fullutf -body {
+test string-22.16.$noComp {string wordstart, unicode} -constraints utf32 -body {
run {string wordstart "\U1D7CA\U1D7CA abc" 10}
} -result 3
diff --git a/tests/stringObj.test b/tests/stringObj.test
index 18c89bb..e5820fc 100644
--- a/tests/stringObj.test
+++ b/tests/stringObj.test
@@ -23,7 +23,7 @@ catch [list package require -exact tcl::test [info patchlevel]]
testConstraint testobj [llength [info commands testobj]]
testConstraint testbytestring [llength [info commands testbytestring]]
testConstraint testdstring [llength [info commands testdstring]]
-testConstraint fullutf [expr {[string length \U010000] == 1}]
+testConstraint utf32 [expr {[string length \U010000] == 1}]
test stringObj-1.1 {string type registration} testobj {
set t [testobj types]
@@ -454,19 +454,19 @@ test stringObj-15.4 {Tcl_Append*ToObj: self appends} testobj {
teststringobj set 1 foo
teststringobj appendself 1 3
} foo
-test stringObj-15.5 {Tcl_Append*ToObj: self appends} {testobj fullutf} {
+test stringObj-15.5 {Tcl_Append*ToObj: self appends} {testobj utf32} {
teststringobj set 1 foo
teststringobj appendself2 1 0
} foofoo
-test stringObj-15.6 {Tcl_Append*ToObj: self appends} {testobj fullutf} {
+test stringObj-15.6 {Tcl_Append*ToObj: self appends} {testobj utf32} {
teststringobj set 1 foo
teststringobj appendself2 1 1
} foooo
-test stringObj-15.7 {Tcl_Append*ToObj: self appends} {testobj fullutf} {
+test stringObj-15.7 {Tcl_Append*ToObj: self appends} {testobj utf32} {
teststringobj set 1 foo
teststringobj appendself2 1 2
} fooo
-test stringObj-15.8 {Tcl_Append*ToObj: self appends} {testobj fullutf} {
+test stringObj-15.8 {Tcl_Append*ToObj: self appends} {testobj utf32} {
teststringobj set 1 foo
teststringobj appendself2 1 3
} foo