summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorjan.nijtmans <nijtmans@users.sourceforge.net>2020-04-06 09:34:42 (GMT)
committerjan.nijtmans <nijtmans@users.sourceforge.net>2020-04-06 09:34:42 (GMT)
commitfc83e1302a252a49290fc451791661208dfca026 (patch)
treed977acfd6d125a44c556acb00faf48d236d9913a
parent2fa58f1e9f1b42d5f1fbbc370a1202e4c7eae52e (diff)
parentdf716cead90670de72a6ac52f7e9375eca9038ef (diff)
downloadtcl-fc83e1302a252a49290fc451791661208dfca026.zip
tcl-fc83e1302a252a49290fc451791661208dfca026.tar.gz
tcl-fc83e1302a252a49290fc451791661208dfca026.tar.bz2
Merge 8.7
-rw-r--r--tests/utf.test16
1 files changed, 11 insertions, 5 deletions
diff --git a/tests/utf.test b/tests/utf.test
index adcbb87..8f1a249 100644
--- a/tests/utf.test
+++ b/tests/utf.test
@@ -123,21 +123,27 @@ test utf-4.5 {Tcl_NumUtfChars: zero length, calc len} testnumutfchars {
testnumutfchars "" 0
} {0}
test utf-4.6 {Tcl_NumUtfChars: length 1, calc len} {testnumutfchars testbytestring} {
- testnumutfchars [testbytestring "\xC2\xA2"] 2
+ testnumutfchars [testbytestring "\xC2\xA2"] end
} {1}
test utf-4.7 {Tcl_NumUtfChars: long string, calc len} {testnumutfchars testbytestring} {
- testnumutfchars [testbytestring "abc\xC2\xA2\xE4\xB9\x8E\xA2\x4E"] 10
+ testnumutfchars [testbytestring "abc\xC2\xA2\xE4\xB9\x8E\uA2\x4E"] end
} {7}
test utf-4.8 {Tcl_NumUtfChars: #u0000, calc len} {testnumutfchars testbytestring} {
- testnumutfchars [testbytestring "\xC0\x80"] 2
+ testnumutfchars [testbytestring "\xC0\x80"] end
} {1}
# Bug [2738427]: Tcl_NumUtfChars(...) no overflow check
test utf-4.9 {Tcl_NumUtfChars: #u20AC, calc len, incomplete} {testnumutfchars testbytestring} {
- testnumutfchars [testbytestring "\xE2\x82\xAC"] 2
+ testnumutfchars [testbytestring "\xE2\x82\xAC"] end-1
} {2}
test utf-4.10 {Tcl_NumUtfChars: #u0000, calc len, overcomplete} {testnumutfchars testbytestring} {
- testnumutfchars [testbytestring "\x00"] 2
+ testnumutfchars [testbytestring "\x00"] end+1
} {2}
+test utf-4.11 {Tcl_NumUtfChars: 3 bytes of 4-byte UTF-8 characater} {testnumutfchars testbytestring} {
+ testnumutfchars [testbytestring \xf0\x9f\x92\xa9] end-1
+} {3}
+test utf-4.12 {Tcl_NumUtfChars: #4-byte UTF-8 character} {testnumutfchars testbytestring fullutf} {
+ testnumutfchars [testbytestring \xf0\x9f\x92\xa9] end
+} {1}
test utf-5.1 {Tcl_UtfFindFirst} {testfindfirst testbytestring} {
testfindfirst [testbytestring "abcbc"] 98