summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorjan.nijtmans <nijtmans@users.sourceforge.net>2011-08-17 06:37:02 (GMT)
committerjan.nijtmans <nijtmans@users.sourceforge.net>2011-08-17 06:37:02 (GMT)
commit5f6458590d2630066c197d4c91986c175c8820e3 (patch)
treeaf4a4b2b39805bf22d191a63f4923f184eb85d2a
parent3323723916d6dd4a6fa97bec7fb95f9299cadf22 (diff)
downloadtcl-5f6458590d2630066c197d4c91986c175c8820e3.zip
tcl-5f6458590d2630066c197d4c91986c175c8820e3.tar.gz
tcl-5f6458590d2630066c197d4c91986c175c8820e3.tar.bz2
separate test for overflowed and negative Tcl_UniChar
-rw-r--r--tests/utf.test9
1 files changed, 6 insertions, 3 deletions
diff --git a/tests/utf.test b/tests/utf.test
index d319f6e..92b3a48 100644
--- a/tests/utf.test
+++ b/tests/utf.test
@@ -27,9 +27,12 @@ test utf-1.3 {Tcl_UniCharToUtf: 2 byte sequences} {
test utf-1.4 {Tcl_UniCharToUtf: 3 byte sequences} {
set x "\u4e4e"
} [bytestring "\xe4\xb9\x8e"]
-test utf-1.5 {Tcl_UniCharToUtf: negative Tcl_UniChar} {
- string length [format %c -1]
-} 1
+test utf-1.5 {Tcl_UniCharToUtf: overflowed Tcl_UniChar} {
+ format %c 0x110000
+} [bytestring "\xef\xbf\xbd"]
+test utf-1.6 {Tcl_UniCharToUtf: negative Tcl_UniChar} {
+ format %c -1
+} [bytestring "\xef\xbf\xbd"]
test utf-2.1 {Tcl_UtfToUniChar: low ascii} {
string length "abc"