From 878a8fdb576ab96d6e8c497e4dffedf82a9afbcf Mon Sep 17 00:00:00 2001 From: Steve Bennett Date: Tue, 31 May 2011 18:34:48 +1000 Subject: Fix a dict sugar parse bug with backslashed chars Signed-off-by: Steve Bennett --- tests/parse.test | 50 ++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 50 insertions(+) (limited to 'tests') 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 -- cgit v1.1