summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorjan.nijtmans <nijtmans@users.sourceforge.net>2018-06-24 20:26:27 (GMT)
committerjan.nijtmans <nijtmans@users.sourceforge.net>2018-06-24 20:26:27 (GMT)
commit94f9cf81ed3e156bd372a3cac249974d1acb4e1d (patch)
tree08b03824658d05ae51a9f7494bed57eb8dd6d8d4 /tests
parent5c87050dd8b6765c40eeef94ab5773d955c3de17 (diff)
downloadtcl-94f9cf81ed3e156bd372a3cac249974d1acb4e1d.zip
tcl-94f9cf81ed3e156bd372a3cac249974d1acb4e1d.tar.gz
tcl-94f9cf81ed3e156bd372a3cac249974d1acb4e1d.tar.bz2
Fix "string tolower" and friends for handling unpaired surrogates correctly. Also add test-cases for those situations.
Various typo's in comments.
Diffstat (limited to 'tests')
-rw-r--r--tests/utf.test15
1 files changed, 15 insertions, 0 deletions
diff --git a/tests/utf.test b/tests/utf.test
index 67a6778..e820359 100644
--- a/tests/utf.test
+++ b/tests/utf.test
@@ -158,6 +158,12 @@ test utf-8.3 {Tcl_UniCharAtIndex: index > 0} {
test utf-8.4 {Tcl_UniCharAtIndex: index > 0} {
string index \u4e4e\u25a\xff\u543 2
} "\uff"
+test utf-8.5 {Tcl_UniCharAtIndex: upper surrogate} {
+ string index \ud842 0
+} "\ud842"
+test utf-8.5 {Tcl_UniCharAtIndex: lower surrogate} {
+ string index \udc42 0
+} "\udc42"
test utf-9.1 {Tcl_UtfAtIndex: index = 0} {
string range abcd 0 2
@@ -263,6 +269,9 @@ test utf-11.4 {Tcl_UtfToUpper} {
test utf-11.5 {Tcl_UtfToUpper Georgian (new in Unicode 11)} {
string toupper \u10d0\u1c90
} \u1c90\u1c90
+test utf-11.6 {Tcl_UtfToUpper low/high surrogate)} {
+ string toupper \udc24\ud824
+} \udc24\ud824
test utf-12.1 {Tcl_UtfToLower} {
string tolower {}
@@ -279,6 +288,9 @@ test utf-12.4 {Tcl_UtfToLower} {
test utf-12.5 {Tcl_UtfToLower Georgian (new in Unicode 11)} {
string tolower \u10d0\u1c90
} \u10d0\u10d0
+test utf-12.6 {Tcl_UtfToUpper low/high surrogate)} {
+ string tolower \udc24\ud824
+} \udc24\ud824
test utf-13.1 {Tcl_UtfToTitle} {
string totitle {}
@@ -298,6 +310,9 @@ test utf-13.5 {Tcl_UtfToTitle Georgian (new in Unicode 11)} {
test utf-13.6 {Tcl_UtfToTitle Georgian (new in Unicode 11)} {
string totitle \u1c90\u10d0
} \u1c90\u10d0
+test utf-13.7 {Tcl_UtfToTitle low/high surrogate)} {
+ string totitle \udc24\ud824
+} \udc24\ud824
test utf-14.1 {Tcl_UtfNcasecmp} {
string compare -nocase a b