summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorjan.nijtmans <nijtmans@users.sourceforge.net>2018-01-11 15:44:05 (GMT)
committerjan.nijtmans <nijtmans@users.sourceforge.net>2018-01-11 15:44:05 (GMT)
commit45e646472daf2fe6beb41555fe088b929cd2ce6c (patch)
treed8ad4e82c79ec2ad95df7052271bca2d665b4be8 /tests
parent063db115239975c5715ab9ecc006341c8f8cd254 (diff)
downloadtcl-45e646472daf2fe6beb41555fe088b929cd2ce6c.zip
tcl-45e646472daf2fe6beb41555fe088b929cd2ce6c.tar.gz
tcl-45e646472daf2fe6beb41555fe088b929cd2ce6c.tar.bz2
Fix behavior of Tcl_GetRange() and "string range" regarding surrogates, when Tcl is compiled with -DTCL_UTF_MAX=4. Partial fix for bug [11ae2be95dac9417]. Also, fix typo.
Diffstat (limited to 'tests')
-rw-r--r--tests/string.test4
1 files changed, 4 insertions, 0 deletions
diff --git a/tests/string.test b/tests/string.test
index bbba5eb..53f1cfb 100644
--- a/tests/string.test
+++ b/tests/string.test
@@ -24,6 +24,7 @@ catch [list package require -exact Tcltest [info patchlevel]]
testConstraint testobj [expr {[info commands testobj] != {}}]
testConstraint testindexobj [expr {[info commands testindexobj] != {}}]
+testConstraint fullutf [expr {[format %c 0x010000] != "\ufffd"}]
# Used for constraining memory leak tests
testConstraint memory [llength [info commands memory]]
@@ -1276,6 +1277,9 @@ test string-12.22 {string range, shimmering binary/index} {
binary scan $s a* x
string range $s $s end
} 000000001
+test string-12.23 {string range, surrogates, bug [11ae2be95dac9417]} fullutf {
+ list [string range a\U100000b 1 1] [string range a\U100000b 2 2] [string range a\U100000b 3 3]
+} [list \U100000 {} b]
test string-13.1 {string repeat} {
list [catch {string repeat} msg] $msg