summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorjan.nijtmans <nijtmans@users.sourceforge.net>2018-06-18 15:59:19 (GMT)
committerjan.nijtmans <nijtmans@users.sourceforge.net>2018-06-18 15:59:19 (GMT)
commit5c87050dd8b6765c40eeef94ab5773d955c3de17 (patch)
tree2f17fcdf4a7c6739c0fbe53952e68767c4657491 /tests
parent5af99f55b25d479c15bfcb63d6959a9611cd6d09 (diff)
parent3c57d80efed172427e5aafa447365cb61439613c (diff)
downloadtcl-5c87050dd8b6765c40eeef94ab5773d955c3de17.zip
tcl-5c87050dd8b6765c40eeef94ab5773d955c3de17.tar.gz
tcl-5c87050dd8b6765c40eeef94ab5773d955c3de17.tar.bz2
Merge 8.6. And add more documentation and test-cases regarding the behavior of Tcl_UniCharToUtf()
Diffstat (limited to 'tests')
-rw-r--r--tests/pkgIndex.tcl8
-rw-r--r--tests/utf.test12
2 files changed, 16 insertions, 4 deletions
diff --git a/tests/pkgIndex.tcl b/tests/pkgIndex.tcl
index 48ab71b..0feb0eb 100644
--- a/tests/pkgIndex.tcl
+++ b/tests/pkgIndex.tcl
@@ -1,6 +1,6 @@
#! /usr/bin/env tclsh
-package ifneeded tcltests 0.1 {
- source [file dirname [file dirname [file normalize [info script]/...]]]/tcltests.tcl
- package provide tcltests 0.1
-}
+package ifneeded tcltests 0.1 "
+ source [list $dir]/tcltests.tcl
+ package provide tcltests 0.1
+"
diff --git a/tests/utf.test b/tests/utf.test
index 9dd8017..67a6778 100644
--- a/tests/utf.test
+++ b/tests/utf.test
@@ -44,6 +44,18 @@ test utf-1.6 {Tcl_UniCharToUtf: negative Tcl_UniChar} testbytestring {
test utf-1.7 {Tcl_UniCharToUtf: 4 byte sequences} -constraints testbytestring -body {
expr {"\U014e4e" eq [testbytestring "\xf0\x94\xb9\x8e"]}
} -result 1
+test utf-1.8 {Tcl_UniCharToUtf: 3 byte sequence, upper surrogate} testbytestring {
+ expr {"\ud842" eq [testbytestring "\xed\xa1\x82"]}
+} 1
+test utf-1.9 {Tcl_UniCharToUtf: 3 byte sequence, lower surrogate} testbytestring {
+ expr {"\udc42" eq [testbytestring "\xed\xb1\x82"]}
+} 1
+test utf-1.10 {Tcl_UniCharToUtf: 3 byte sequence, upper surrogate} testbytestring {
+ expr {[format %c 0xd842] eq [testbytestring "\xed\xa1\x82"]}
+} 1
+test utf-1.11 {Tcl_UniCharToUtf: 3 byte sequence, lower surrogate} testbytestring {
+ expr {[format %c 0xdc42] eq [testbytestring "\xed\xb1\x82"]}
+} 1
test utf-2.1 {Tcl_UtfToUniChar: low ascii} {
string length "abc"