summaryrefslogtreecommitdiffstats
path: root/tests/dstring.test
diff options
context:
space:
mode:
authordgp <dgp@users.sourceforge.net>2003-07-24 16:05:22 (GMT)
committerdgp <dgp@users.sourceforge.net>2003-07-24 16:05:22 (GMT)
commitdb3db9df91cdc7d1b0bdac6c9c927765ce9afd95 (patch)
tree829c6228c7d8db111e9b0b193de20a6c182b21be /tests/dstring.test
parent69bc2d2dcd6bd96a75ea42e0fdb1c23fc1054390 (diff)
downloadtcl-db3db9df91cdc7d1b0bdac6c9c927765ce9afd95.zip
tcl-db3db9df91cdc7d1b0bdac6c9c927765ce9afd95.tar.gz
tcl-db3db9df91cdc7d1b0bdac6c9c927765ce9afd95.tar.bz2
* tests/async.test: Added several tests that demonstrate Tcl
* tests/basic.test: Bug 489537, Tcl's longstanding failure to * tests/dict.test: properly quote any leading '#' character * tests/dstring.test: when generating the string rep of a list * tests/list.test: so that the comment-power of that character * tests/parse.test: is hidden from any [eval], in order to * tests/util.test: satisfy the documentation that [list] does [eval]-safe quoting.
Diffstat (limited to 'tests/dstring.test')
-rw-r--r--tests/dstring.test79
1 files changed, 78 insertions, 1 deletions
diff --git a/tests/dstring.test b/tests/dstring.test
index 6c9276b..5a8b3b2 100644
--- a/tests/dstring.test
+++ b/tests/dstring.test
@@ -11,7 +11,7 @@
# See the file "license.terms" for information on usage and redistribution
# of this file, and for a DISCLAIMER OF ALL WARRANTIES.
#
-# RCS: @(#) $Id: dstring.test,v 1.5 2000/04/10 17:18:58 ericm Exp $
+# RCS: @(#) $Id: dstring.test,v 1.6 2003/07/24 16:05:24 dgp Exp $
if {[lsearch [namespace children] ::tcltest] == -1} {
package require tcltest
@@ -113,6 +113,37 @@ test dstring-2.8 {appending list elements} {
testdstring element abc
testdstring get
} {x abc}
+test dstring-2.9 {appending list elements} {
+ testdstring free
+ testdstring element #
+ testdstring get
+} {{#}}
+test dstring-2.10 {appending list elements} {
+ testdstring free
+ testdstring append " " -1
+ testdstring element #
+ testdstring get
+} { {#}}
+test dstring-2.11 {appending list elements} {
+ testdstring free
+ testdstring append \t -1
+ testdstring element #
+ testdstring get
+} \t{#}
+test dstring-2.12 {appending list elements} {
+ testdstring free
+ testdstring append x -1
+ testdstring element #
+ testdstring get
+} {x #}
+test dstring-2.13 {appending list elements} {
+ # This test shows lack of sophistication in Tcl_DStringAppendElement's
+ # decision about whether #-quoting can be disabled.
+ testdstring free
+ testdstring append "x " -1
+ testdstring element #
+ testdstring get
+} {x {#}}
test dstring-3.1 {nested sublists} {
testdstring free
@@ -167,6 +198,52 @@ test dstring-3.5 {nested sublists} {
testdstring end
testdstring get
} {\{ {first second}}
+test dstring-3.6 {appending list elements} {
+ testdstring free
+ testdstring append x -1
+ testdstring start
+ testdstring element #
+ testdstring end
+ testdstring get
+} {x {{#}}}
+test dstring-3.7 {appending list elements} {
+ testdstring free
+ testdstring append x -1
+ testdstring start
+ testdstring append " " -1
+ testdstring element #
+ testdstring end
+ testdstring get
+} {x { {#}}}
+test dstring-3.8 {appending list elements} {
+ testdstring free
+ testdstring append x -1
+ testdstring start
+ testdstring append \t -1
+ testdstring element #
+ testdstring end
+ testdstring get
+} "x {\t{#}}"
+test dstring-3.9 {appending list elements} {
+ testdstring free
+ testdstring append x -1
+ testdstring start
+ testdstring append x -1
+ testdstring element #
+ testdstring end
+ testdstring get
+} {x {x #}}
+test dstring-3.10 {appending list elements} {
+ # This test shows lack of sophistication in Tcl_DStringAppendElement's
+ # decision about whether #-quoting can be disabled.
+ testdstring free
+ testdstring append x -1
+ testdstring start
+ testdstring append "x " -1
+ testdstring element #
+ testdstring end
+ testdstring get
+} {x {x {#}}}
test dstring-4.1 {truncation} {
testdstring free