summaryrefslogtreecommitdiffstats
path: root/tests/util.test
diff options
context:
space:
mode:
authorjan.nijtmans <nijtmans@users.sourceforge.net>2020-04-14 14:30:35 (GMT)
committerjan.nijtmans <nijtmans@users.sourceforge.net>2020-04-14 14:30:35 (GMT)
commit6a0b66fc79d01eac04951c8d0bd0a4412c3b9c91 (patch)
tree740553533208a7d59ce076bc595179164dfb10ee /tests/util.test
parent527a481e1a5488fe6c9f00e9b9531b78c52ca8cc (diff)
parent1faed93cada29bd263dfed0b7b5df50e86defd39 (diff)
downloadtcl-6a0b66fc79d01eac04951c8d0bd0a4412c3b9c91.zip
tcl-6a0b66fc79d01eac04951c8d0bd0a4412c3b9c91.tar.gz
tcl-6a0b66fc79d01eac04951c8d0bd0a4412c3b9c91.tar.bz2
Merge 8.7
Diffstat (limited to 'tests/util.test')
-rw-r--r--tests/util.test59
1 files changed, 51 insertions, 8 deletions
diff --git a/tests/util.test b/tests/util.test
index 49fbebf..6a91a69 100644
--- a/tests/util.test
+++ b/tests/util.test
@@ -384,6 +384,10 @@ test util-5.50 {Tcl_StringMatch} {
test util-5.51 {Tcl_StringMatch} {
Wrapper_Tcl_StringMatch "" ""
} 1
+test util-5.52 {Tcl_StringMatch} {
+ Wrapper_Tcl_StringMatch \[a\u0000 a\x80
+} 0
+
test util-6.5 {Tcl_PrintDouble - make sure there's a decimal point} {
concat x[expr 2.0]
@@ -433,25 +437,64 @@ test util-8.4 {TclNeedSpace - correct UTF8 handling} testdstring {
llength [testdstring get]
} 2
test util-8.5 {TclNeedSpace - correct UTF8 handling} testdstring {
- # Note that in this test TclNeedSpace actually gets it wrong,
- # claiming we need a space when we really do not. Extra space
- # between list elements is harmless though, and better to have
- # extra space in really weird string reps of lists, than to
- # invest the effort required to make TclNeedSpace foolproof.
testdstring free
testdstring append {\\ } -1
testdstring element foo
list [llength [testdstring get]] [string length [testdstring get]]
-} {2 7}
+} {2 6}
test util-8.6 {TclNeedSpace - correct UTF8 handling} testdstring {
- # Another example of TclNeedSpace harmlessly getting it wrong.
testdstring free
testdstring append {\\ } -1
testdstring append \{ -1
testdstring element foo
testdstring append \} -1
list [llength [testdstring get]] [string length [testdstring get]]
-} {2 9}
+} {2 8}
+test util-8.7 {TclNeedSpace - watch out for escaped space} {
+ testdstring free
+ testdstring append {\ } -1
+ testdstring start
+ testdstring end
+
+ # Should make {\ {}}
+ list [llength [testdstring get]] [string index [testdstring get] 3]
+} {2 \{}
+test util-8.8 {TclNeedSpace - watch out for escaped space} {
+ testdstring free
+ testdstring append {\\ } -1
+ testdstring start
+ testdstring end
+
+ # Should make {\\ {}}
+ list [llength [testdstring get]] [string index [testdstring get] 3]
+} {2 \{}
+test util-8.9 {TclNeedSpace - watch out for escaped space} {
+ testdstring free
+ testdstring append {\\\ } -1
+ testdstring start
+ testdstring end
+
+ # Should make {\\\ {}}
+ list [llength [testdstring get]] [string index [testdstring get] 5]
+} {2 \{}
+test util-8.10 {TclNeedSpace - watch out for escaped space} {
+ testdstring free
+ testdstring append {\\\\\\\ } -1
+ testdstring start
+ testdstring end
+
+ # Should make {\\\\\\\ {}}
+ list [llength [testdstring get]] [string index [testdstring get] 9]
+} {2 \{}
+test util-8.11 {TclNeedSpace - watch out for escaped space} {
+ testdstring free
+ testdstring append {\\\\\\\\ } -1
+ testdstring start
+ testdstring end
+
+ # Should make {\\\\\\\\ {}}
+ list [llength [testdstring get]] [string index [testdstring get] 9]
+} {2 \{}
test util-9.0.0 {Tcl_GetIntForIndex} {
string index abcd 0