diff options
author | Steve Bennett <steveb@workware.net.au> | 2010-10-05 13:16:25 +1000 |
---|---|---|
committer | Steve Bennett <steveb@workware.net.au> | 2010-10-15 11:02:58 +1000 |
commit | 352d450a94f89b4415c4d3ee56664d9815389b94 (patch) | |
tree | 9494757bb04e57df001e6cc09f27af1a9e4f13c4 /tests/concat.test | |
parent | 22fc43c8dbca0205c854ae6e1c7f2c9c3c354125 (diff) | |
download | jimtcl-352d450a94f89b4415c4d3ee56664d9815389b94.zip jimtcl-352d450a94f89b4415c4d3ee56664d9815389b94.tar.gz jimtcl-352d450a94f89b4415c4d3ee56664d9815389b94.tar.bz2 |
Fix a concat bug
If a string ended in backslash-space, the trailing space was lost.
Signed-off-by: Steve Bennett <steveb@workware.net.au>
Diffstat (limited to 'tests/concat.test')
-rw-r--r-- | tests/concat.test | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/tests/concat.test b/tests/concat.test index 65d6e1b..7f961a8 100644 --- a/tests/concat.test +++ b/tests/concat.test @@ -30,3 +30,35 @@ test concat-4.2 {pruning off extra white space} { test concat-4.3 {pruning off extra white space sets length correctly} { llength [concat { {{a}} }] } 1 + +test concat-5.1 {Tcl_ScanCountedElement procedure - don't leave unmatched braces} { + # This test checks for a very tricky feature. Any list element + # generated with Tcl_ScanCountedElement and Tcl_ConvertElement must + # have the property that it can be enclosing in curly braces to make + # an embedded sub-list. If this property doesn't hold, then + # Tcl_DStringStartSublist doesn't work. + + set x {} + lappend x " \\\{ \\" + concat $x [llength "{$x}"] +} {\ \\\{\ \\ 1} + +test concat-6.1 {Tcl_ConcatObj - backslash-space at end of argument} { + concat a {b\ } c +} {a b\ c} +test concat-6.2 {Tcl_ConcatObj - backslash-space at end of argument} { + concat a {b\ } c +} {a b\ c} +test concat-6.3 {Tcl_ConcatObj - backslash-space at end of argument} { + concat a {b\\ } c +} {a b\\ c} +test concat-6.4 {Tcl_ConcatObj - backslash-space at end of argument} { + concat a {b } c +} {a b c} +test concat-6.5 {Tcl_ConcatObj - backslash-space at end of argument} { + concat a { } c +} {a c} +test concat-6.6 {Tcl_ConcatObj - utf-8 sequence with "whitespace" char} { + # Check for Bug #227512. If this violates C isspace, then it returns \xc3. + concat \xe0 +} \xe0 |