diff options
author | Steve Bennett <steveb@workware.net.au> | 2011-05-31 18:34:48 +1000 |
---|---|---|
committer | Steve Bennett <steveb@workware.net.au> | 2011-05-31 18:34:48 +1000 |
commit | 878a8fdb576ab96d6e8c497e4dffedf82a9afbcf (patch) | |
tree | 137f651cb7f74696153cdf8471b2642c9a722e00 /tests | |
parent | c09f838395bcc33cae854be44a2be5020fb45f87 (diff) | |
download | jimtcl-878a8fdb576ab96d6e8c497e4dffedf82a9afbcf.zip jimtcl-878a8fdb576ab96d6e8c497e4dffedf82a9afbcf.tar.gz jimtcl-878a8fdb576ab96d6e8c497e4dffedf82a9afbcf.tar.bz2 |
Fix a dict sugar parse bug with backslashed chars
Signed-off-by: Steve Bennett <steveb@workware.net.au>
Diffstat (limited to 'tests')
-rw-r--r-- | tests/parse.test | 50 |
1 files changed, 50 insertions, 0 deletions
diff --git a/tests/parse.test b/tests/parse.test index 870d4ff..d8e6035 100644 --- a/tests/parse.test +++ b/tests/parse.test @@ -256,4 +256,54 @@ test parse-1.50 "backslash newline in quotes" { def" } "abc def" +test parse-1.51 "special chars in dict sugar" { + unset -nocomplain a + set a(x$) 5 + array names a +} {{x$}} + +test parse-1.52 "special chars in dict sugar" { + set x $a(x$) +} 5 + +test parse-1.53 "special chars in dict sugar" { + unset -nocomplain a + set a(x\[) 5 + array names a +} {{x[}} + +test parse-1.52 "special chars in dict sugar" { + set x $a(x\[) +} 5 + +test parse-1.53 "special chars in dict sugar" { + unset -nocomplain a + set a(x\() 5 + array names a +} {x(} + +test parse-1.52 "special chars in dict sugar" { + set x $a(x\() +} 5 + +test parse-1.53 "special chars in dict sugar" { + unset -nocomplain a + set a(x() 5 + array names a +} {x(} + +test parse-1.52 "special chars in dict sugar" { + set x $a(x() +} 5 + +test parse-1.53 "special chars in dict sugar" { + unset -nocomplain a + set a(x") 5 + lindex [array names a] 0 +} {x"} + +test parse-1.52 "special chars in dict sugar" { + set x $a(x") +} 5 + testreport |