summaryrefslogtreecommitdiffstats
path: root/tests/utf.test
diff options
context:
space:
mode:
authordgp <dgp@users.sourceforge.net>2020-04-26 20:49:43 (GMT)
committerdgp <dgp@users.sourceforge.net>2020-04-26 20:49:43 (GMT)
commite4c1bf052f3292b8ded9e2010c051b7f62aee95a (patch)
treeccdf1437b4067561800fddeeef29445c27d9fac2 /tests/utf.test
parented18a32961f351fe67a6410c4b0368ca5ecf4848 (diff)
downloadtcl-e4c1bf052f3292b8ded9e2010c051b7f62aee95a.zip
tcl-e4c1bf052f3292b8ded9e2010c051b7f62aee95a.tar.gz
tcl-e4c1bf052f3292b8ded9e2010c051b7f62aee95a.tar.bz2
Tests demonstrating the bug. Work on a fix can go here.
Diffstat (limited to 'tests/utf.test')
-rw-r--r--tests/utf.test8
1 files changed, 8 insertions, 0 deletions
diff --git a/tests/utf.test b/tests/utf.test
index b588976..3ff7d47 100644
--- a/tests/utf.test
+++ b/tests/utf.test
@@ -78,6 +78,14 @@ test utf-1.12 {Tcl_UniCharToUtf: 4 byte sequence, high/low surrogate} {pairsTo4b
test utf-1.13 {Tcl_UniCharToUtf: Invalid surrogate} {Uesc testbytestring} {
expr {"\UD842" eq [testbytestring "\xEF\xBF\xBD"]}
} 1
+test utf-1.14 {Tcl_UniCharToUtf: surrogate pairs from concat} {pairsTo4bytes testbytestring} {
+ set hi \uD842
+ set lo \uDC42
+ eq "$hi$lo" [testbytestring \xF0\xA0\xA1\x92]
+} 1
+test utf-1.15 {Tcl_UniCharToUtf: surrogate pairs from concat} {pairsTo4bytes testbytestring} {
+ eq [string cat \uD842 \uDC42] [testbytestring \xF0\xA0\xA1\x92]
+} 1
test utf-2.1 {Tcl_UtfToUniChar: low ascii} {
string length "abc"