diff options
| author | jan.nijtmans <nijtmans@users.sourceforge.net> | 2023-09-20 08:34:26 (GMT) |
|---|---|---|
| committer | jan.nijtmans <nijtmans@users.sourceforge.net> | 2023-09-20 08:34:26 (GMT) |
| commit | 00b8ea1f818b6a80a7143abb5bf2eaf4fa8981dd (patch) | |
| tree | d97676e3f5a1d9c94bbe4d7d08b1f4e01a4deefd | |
| parent | 8c6f2a1ec03ad26fc300da9408e6a6388942f073 (diff) | |
| parent | 98f9c60d3a969593c2e8695d4b6c82ee1fa44b70 (diff) | |
| download | tcl-00b8ea1f818b6a80a7143abb5bf2eaf4fa8981dd.zip tcl-00b8ea1f818b6a80a7143abb5bf2eaf4fa8981dd.tar.gz tcl-00b8ea1f818b6a80a7143abb5bf2eaf4fa8981dd.tar.bz2 | |
Merge 8.7
| -rw-r--r-- | tests/encoding.test | 14 | ||||
| -rw-r--r-- | tests/string.test | 21 | ||||
| -rw-r--r-- | tests/stringObj.test | 9 |
3 files changed, 18 insertions, 26 deletions
diff --git a/tests/encoding.test b/tests/encoding.test index 49d9066..712991c 100644 --- a/tests/encoding.test +++ b/tests/encoding.test @@ -40,9 +40,6 @@ testConstraint testbytestring [llength [info commands testbytestring]] testConstraint teststringbytes [llength [info commands teststringbytes]] testConstraint exec [llength [info commands exec]] testConstraint testgetencpath [llength [info commands testgetencpath]] -testConstraint fullutf [expr {[format %c 0x010000] ne "\uFFFD"}] -testConstraint utf32 [expr {[testConstraint fullutf] - && [string length [format %c 0x10000]] == 1}] # TclInitEncodingSubsystem is tested by the rest of this file # TclFinalizeEncodingSubsystem is not currently tested @@ -343,7 +340,7 @@ test encoding-15.5 {UtfToUtfProc emoji character input} { set y [encoding convertfrom utf-8 \xF0\x9F\x98\x82] list [string length $x] $y } "4 😂" -test encoding-15.6 {UtfToUtfProc emoji character output} utf32 { +test encoding-15.6 {UtfToUtfProc emoji character output} { set x \uDE02\uD83D\uDE02\uD83D set y [encoding convertto -profile tcl8 utf-8 \uDE02\uD83D\uDE02\uD83D] binary scan $y H* z @@ -506,7 +503,7 @@ test encoding-16.8 {Utf32ToUtfProc} -body { set val [encoding convertfrom -profile tcl8 utf-32 \x41\x00\x00\x41] list $val [format %x [scan $val %c]] } -result "\uFFFD fffd" -test encoding-16.9 {Utf32ToUtfProc} -constraints utf32 -body { +test encoding-16.9 {Utf32ToUtfProc} -body { encoding convertfrom -profile tcl8 utf-32le \x00\xD8\x00\x00 } -result \uD800 test encoding-16.10 {Utf32ToUtfProc} -body { @@ -515,7 +512,7 @@ test encoding-16.10 {Utf32ToUtfProc} -body { test encoding-16.11 {Utf32ToUtfProc} -body { encoding convertfrom -profile tcl8 utf-32le \x00\xD8\x00\x00\x00\xDC\x00\x00 } -result \uD800\uDC00 -test encoding-16.12 {Utf32ToUtfProc} -constraints utf32 -body { +test encoding-16.12 {Utf32ToUtfProc} -body { encoding convertfrom -profile tcl8 utf-32le \x00\xDC\x00\x00\x00\xD8\x00\x00 } -result \uDC00\uD800 test encoding-16.13 {Utf16ToUtfProc} -body { @@ -559,8 +556,7 @@ test {encoding-16.19 strict} {Utf16ToUtfProc, bug [d19fe0a5b]} -body { test {encoding-16.19 tcl8} {Utf16ToUtfProc, bug [d19fe0a5b]} -body { encoding convertfrom -profile tcl8 utf-16 "\x41\x41\x41" } -result \u4141\uFFFD -test encoding-16.20 {utf16ToUtfProc, bug [d19fe0a5b]} \ - -constraints deprecated -body { +test encoding-16.20 {utf16ToUtfProc, bug [d19fe0a5b]} -body { encoding convertfrom utf-16 "\xD8\xD8" } -result \uD8D8 test encoding-16.21.tcl8 {Utf32ToUtfProc, bug [d19fe0a5b]} -body { @@ -869,7 +865,7 @@ test encoding-24.33 {Try to generate invalid utf-8} -body { test encoding-24.34 {Try to generate invalid utf-8 with -profile tcl8} -body { encoding convertto -profile tcl8 utf-8 \uFFFF } -result \xEF\xBF\xBF -test encoding-24.35 {Parse invalid utf-8} -constraints utf32 -body { +test encoding-24.35 {Parse invalid utf-8} -body { encoding convertfrom -profile tcl8 utf-8 \xED\xA0\x80 } -result \uD800 test encoding-24.36 {Parse invalid utf-8 with -profile strict} -body { diff --git a/tests/string.test b/tests/string.test index 238b251..a232f1e 100644 --- a/tests/string.test +++ b/tests/string.test @@ -33,10 +33,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 {[format %c 0x010000] ne "\uFFFD"}] testConstraint testbytestring [llength [info commands testbytestring]] -testConstraint utf32 [expr {[testConstraint fullutf] - && [string length [format %c 0x10000]] == 1}] # Used for constraining memory leak tests testConstraint memory [llength [info commands memory]] @@ -518,7 +515,7 @@ test string-5.19.$noComp {string index, bytearray object out of bounds} { 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 utf32 -body { +test string-5.21.$noComp {string index, surrogates, bug [11ae2be95dac9417]} -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 { @@ -1522,7 +1519,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]} utf32 { +test string-12.23.$noComp {string range, surrogates, bug [11ae2be95dac9417]} { 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 { @@ -1792,7 +1789,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]} utf32 { +test string-17.9.$noComp {string totitle, surrogates, bug [11ae2be95dac9417]} { 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] @@ -1936,7 +1933,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 utf32 -body { +test string-21.16.$noComp {string wordend, unicode} -body { run {string wordend "\U1D7CA\U1D7CA abc" 10} } -result 6 test string-21.17.$noComp {string trim, unicode} { @@ -2014,7 +2011,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 utf32 -body { +test string-22.16.$noComp {string wordstart, unicode} -body { run {string wordstart "\U1D7CA\U1D7CA abc" 10} } -result 3 @@ -2128,19 +2125,19 @@ test string-24.15.$noComp {string reverse command - pure bytearray} { binary scan [run {tcl::string::reverse [binary format H* 010203]}] H* x set x } 030201 -test string-24.16.$noComp {string reverse command - surrogates} utf32 { +test string-24.16.$noComp {string reverse command - surrogates} { run {string reverse \u0444bulb\uD83D\uDE02} } \uDE02\uD83Dblub\u0444 -test string-24.17.$noComp {string reverse command - surrogates} utf32 { +test string-24.17.$noComp {string reverse command - surrogates} { run {string reverse \uD83D\uDE02hello\uD83D\uDE02} } \uDE02\uD83Dolleh\uDE02\uD83D -test string-24.18.$noComp {string reverse command - surrogates} utf32 { +test string-24.18.$noComp {string reverse command - surrogates} { set s \u0444bulb\uD83D\uDE02 # shim shimmery ... string index $s 0 run {string reverse $s} } \uDE02\uD83Dblub\u0444 -test string-24.19.$noComp {string reverse command - surrogates} utf32 { +test string-24.19.$noComp {string reverse command - surrogates} { set s \uD83D\uDE02hello\uD83D\uDE02 # shim shimmery ... string index $s 0 diff --git a/tests/stringObj.test b/tests/stringObj.test index 71cf63e..605c9dd 100644 --- a/tests/stringObj.test +++ b/tests/stringObj.test @@ -23,7 +23,6 @@ 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 utf32 [expr {[string length \U010000] == 1}] test stringObj-1.1 {string type registration} testobj { set t [testobj types] @@ -457,19 +456,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 utf32} { +test stringObj-15.5 {Tcl_Append*ToObj: self appends} testobj { teststringobj set 1 foo teststringobj appendself2 1 0 } foofoo -test stringObj-15.6 {Tcl_Append*ToObj: self appends} {testobj utf32} { +test stringObj-15.6 {Tcl_Append*ToObj: self appends} testobj { teststringobj set 1 foo teststringobj appendself2 1 1 } foooo -test stringObj-15.7 {Tcl_Append*ToObj: self appends} {testobj utf32} { +test stringObj-15.7 {Tcl_Append*ToObj: self appends} testobj { teststringobj set 1 foo teststringobj appendself2 1 2 } fooo -test stringObj-15.8 {Tcl_Append*ToObj: self appends} {testobj utf32} { +test stringObj-15.8 {Tcl_Append*ToObj: self appends} testobj { teststringobj set 1 foo teststringobj appendself2 1 3 } foo |
