diff options
Diffstat (limited to 'tests')
-rw-r--r-- | tests/util.test | 22 |
1 files changed, 21 insertions, 1 deletions
diff --git a/tests/util.test b/tests/util.test index ddba3e4..6c4db29 100644 --- a/tests/util.test +++ b/tests/util.test @@ -7,7 +7,7 @@ # See the file "license.terms" for information on usage and redistribution # of this file, and for a DISCLAIMER OF ALL WARRANTIES. # -# RCS: @(#) $Id: util.test,v 1.12 2003/08/27 17:57:03 dgp Exp $ +# RCS: @(#) $Id: util.test,v 1.13 2003/08/27 20:29:36 dgp Exp $ if {[lsearch [namespace children] ::tcltest] == -1} { package require tcltest @@ -375,6 +375,26 @@ test util-8.4 {TclNeedSpace - correct UTF8 handling} testdstring { testdstring element foo 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} +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} # cleanup ::tcltest::cleanupTests |