diff options
author | dgp <dgp@users.sourceforge.net> | 2020-04-17 20:15:07 (GMT) |
---|---|---|
committer | dgp <dgp@users.sourceforge.net> | 2020-04-17 20:15:07 (GMT) |
commit | 1e5043ff451573bf735f6aec84208af7f0c24cc2 (patch) | |
tree | f66fd33e2e7fe0a79a9529cf793f5b49a65c253b /tests | |
parent | 4b0626ddd7e1f7450781deb2508d94a98c8db93d (diff) | |
download | tcl-1e5043ff451573bf735f6aec84208af7f0c24cc2.zip tcl-1e5043ff451573bf735f6aec84208af7f0c24cc2.tar.gz tcl-1e5043ff451573bf735f6aec84208af7f0c24cc2.tar.bz2 |
Backport a collection of tests for consistency between branches.
Diffstat (limited to 'tests')
-rw-r--r-- | tests/utf.test | 17 |
1 files changed, 12 insertions, 5 deletions
diff --git a/tests/utf.test b/tests/utf.test index a22dafe..ff4f4a9 100644 --- a/tests/utf.test +++ b/tests/utf.test @@ -57,15 +57,22 @@ test utf-2.6 {Tcl_UtfToUniChar: lead (3-byte) followed by 1 trail} { test utf-2.7 {Tcl_UtfToUniChar: lead (3-byte) followed by 2 trail} { string length [bytestring "\xE4\xb9\x8e"] } {1} -test utf-2.8 {Tcl_UtfToUniChar: longer UTF sequences not supported} { - string length [bytestring "\xF4\xA2\xA2\xA2"] +test utf-2.8 {Tcl_UtfToUniChar: lead (4-byte) followed by 3 trail} -constraints {testbytestring} -body { + string length [testbytestring "\xF0\x90\x80\x80"] +} -result {4} +test utf-2.9 {Tcl_UtfToUniChar: lead (4-byte) followed by 3 trail} -constraints {testbytestring} -body { + string length [testbytestring "\xF4\x8F\xBF\xBF"] +} -result {4} +test utf-2.10 {Tcl_UtfToUniChar: lead (4-byte) followed by 3 trail, underflow} testbytestring { + string length [testbytestring "\xF0\x8F\xBF\xBF"] } {4} - -test utf-2.11 {Tcl_UtfToUniChar: lead (4-byte) followed by 3 trail, invalid} testbytestring { +test utf-2.11 {Tcl_UtfToUniChar: lead (4-byte) followed by 3 trail, overflow} testbytestring { # Would decode to U+110000 but that is outside the Unicode range. string length [testbytestring "\xF4\x90\x80\x80"] } {4} - +test utf-2.12 {Tcl_UtfToUniChar: longer UTF sequences not supported} testbytestring { + string length [testbytestring "\xF8\xA2\xA2\xA2\xA2"] +} {5} test utf-3.1 {Tcl_UtfCharComplete} { } {} |