summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authordgp <dgp@users.sourceforge.net>2020-04-26 21:15:17 (GMT)
committerdgp <dgp@users.sourceforge.net>2020-04-26 21:15:17 (GMT)
commitb5fdc14e81271ed058235daa7b150b9f569e365c (patch)
tree5092108c21b3a6559f524c880263acf224dc2df1
parented18a32961f351fe67a6410c4b0368ca5ecf4848 (diff)
parente4bd95ebe3dc2608e28ac07b58252f68bf308e98 (diff)
downloadtcl-b5fdc14e81271ed058235daa7b150b9f569e365c.zip
tcl-b5fdc14e81271ed058235daa7b150b9f569e365c.tar.gz
tcl-b5fdc14e81271ed058235daa7b150b9f569e365c.tar.bz2
merge 8.6
-rw-r--r--tests/utf.test20
1 files changed, 17 insertions, 3 deletions
diff --git a/tests/utf.test b/tests/utf.test
index b588976..2935235 100644
--- a/tests/utf.test
+++ b/tests/utf.test
@@ -20,7 +20,9 @@ catch [list package require -exact Tcltest [info patchlevel]]
testConstraint ucs2 [expr {[format %c 0x010000] eq "\uFFFD"}]
testConstraint fullutf [expr {[format %c 0x010000] ne "\uFFFD"}]
-testConstraint tip389 [expr {[string length \U010000] eq 2}]
+testConstraint tip389 [expr {[string length [format %c 0x10000]] eq 2}]
+testConstraint ucs4 [expr {[testConstraint fullutf]
+ && [string length [format %c 0x10000]] == 1}]
testConstraint Uesc [eq \U0041 A]
testConstraint pairsTo4bytes [expr {[llength [info commands teststringbytes]]
@@ -100,10 +102,22 @@ test utf-2.6 {Tcl_UtfToUniChar: lead (3-byte) followed by 1 trail} testbytestrin
test utf-2.7 {Tcl_UtfToUniChar: lead (3-byte) followed by 2 trail} testbytestring {
string length [testbytestring "\xE4\xB9\x8E"]
} 1
-test utf-2.8 {Tcl_UtfToUniChar: lead (4-byte) followed by 3 trail} {tip389 testbytestring} {
+test utf-2.8.0 {Tcl_UtfToUniChar: lead (4-byte) followed by 3 trail} {testbytestring ucs2} {
+ string length [testbytestring "\xF0\x90\x80\x80"]
+} 4
+test utf-2.8.1 {Tcl_UtfToUniChar: lead (4-byte) followed by 3 trail} {testbytestring ucs4} {
+ string length [testbytestring "\xF0\x90\x80\x80"]
+} 1
+test utf-2.8.2 {Tcl_UtfToUniChar: lead (4-byte) followed by 3 trail} {testbytestring tip389} {
string length [testbytestring "\xF0\x90\x80\x80"]
} 2
-test utf-2.9 {Tcl_UtfToUniChar: lead (4-byte) followed by 3 trail} {tip389 testbytestring} {
+test utf-2.9.0 {Tcl_UtfToUniChar: lead (4-byte) followed by 3 trail} {testbytestring ucs2} {
+ string length [testbytestring "\xF4\x8F\xBF\xBF"]
+} 4
+test utf-2.9.1 {Tcl_UtfToUniChar: lead (4-byte) followed by 3 trail} {testbytestring ucs4} {
+ string length [testbytestring "\xF4\x8F\xBF\xBF"]
+} 1
+test utf-2.9.2 {Tcl_UtfToUniChar: lead (4-byte) followed by 3 trail} {testbytestring tip389} {
string length [testbytestring "\xF4\x8F\xBF\xBF"]
} 2
test utf-2.10 {Tcl_UtfToUniChar: lead (4-byte) followed by 3 trail, underflow} testbytestring {