summaryrefslogtreecommitdiffstats
path: root/tests/utf.test
diff options
context:
space:
mode:
authorjan.nijtmans <nijtmans@users.sourceforge.net>2011-12-23 23:31:50 (GMT)
committerjan.nijtmans <nijtmans@users.sourceforge.net>2011-12-23 23:31:50 (GMT)
commite1074be4bf98ca2d9b91651693f0da2ee6c1042d (patch)
tree734ea4baca3122811a21881af45abe7a10d5a38f /tests/utf.test
parentffa41c2677af95d32514e51ef9bf3cf2cdfcf29b (diff)
downloadtcl-e1074be4bf98ca2d9b91651693f0da2ee6c1042d.zip
tcl-e1074be4bf98ca2d9b91651693f0da2ee6c1042d.tar.gz
tcl-e1074be4bf98ca2d9b91651693f0da2ee6c1042d.tar.bz2
[Bug 3464428] string is graph \u0120 is wrong
Diffstat (limited to 'tests/utf.test')
-rw-r--r--tests/utf.test21
1 files changed, 18 insertions, 3 deletions
diff --git a/tests/utf.test b/tests/utf.test
index af84b54..6d6f301 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"
@@ -282,6 +285,14 @@ test utf-21.2 {unicode alnum char in regc_locale.c} {
# this returns 1 with Unicode 6 compliance
list [regexp {^[[:alnum:]]+$} \u1040\u021f\u0220] [regexp {^\w+$} \u1040\u021f\u0220]
} {1 1}
+test utf-21.4 {TclUniCharIsGraph} {
+ # [Bug 3464428]
+ string is graph \u0120
+} {1}
+test utf-21.5 {unicode graph char in regc_locale.c} {
+ # [Bug 3464428]
+ regexp {^[[:graph:]]+$} \u0120
+} {1}
test utf-22.1 {TclUniCharIsWordChar} {
string wordend "xyz123_bar fg" 0
@@ -355,3 +366,7 @@ test utf-25.4 {Tcl_UniCharNcasecmp} teststringobj {
# cleanup
::tcltest::cleanupTests
return
+
+# Local Variables:
+# mode: tcl
+# End: