diff options
author | dgp <dgp@noemail.net> | 2003-07-24 16:05:22 (GMT) |
---|---|---|
committer | dgp <dgp@noemail.net> | 2003-07-24 16:05:22 (GMT) |
commit | def4d890d0cfe499ae2aae2dcc3081039df74236 (patch) | |
tree | 829c6228c7d8db111e9b0b193de20a6c182b21be /tests/dstring.test | |
parent | 10023ed86915c455b083d924c9b304f436d815ac (diff) | |
download | tcl-def4d890d0cfe499ae2aae2dcc3081039df74236.zip tcl-def4d890d0cfe499ae2aae2dcc3081039df74236.tar.gz tcl-def4d890d0cfe499ae2aae2dcc3081039df74236.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.
FossilOrigin-Name: 03d3df98ff7cdfa4ebd84d70cf3d5ecb99bab3c5
Diffstat (limited to 'tests/dstring.test')
-rw-r--r-- | tests/dstring.test | 79 |
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 |