diff options
author | dkf <donal.k.fellows@manchester.ac.uk> | 2011-10-09 14:41:06 (GMT) |
---|---|---|
committer | dkf <donal.k.fellows@manchester.ac.uk> | 2011-10-09 14:41:06 (GMT) |
commit | 2befc6793de3b9eba7c26d5def4cdfc023a8824b (patch) | |
tree | 2c40948bd6348456fbd7e6a7c6910b8f3d59d5d7 /tests | |
parent | b5ef14e4f16a379a7bfe4af4b6ec0a3076856b8d (diff) | |
download | tcl-2befc6793de3b9eba7c26d5def4cdfc023a8824b.zip tcl-2befc6793de3b9eba7c26d5def4cdfc023a8824b.tar.gz tcl-2befc6793de3b9eba7c26d5def4cdfc023a8824b.tar.bz2 |
* generic/tclCompCmds.c (TclCompileDictWithCmd): Corrected handling of
qualified names, and added spacial cases for empty bodies (used when
[dict with] is just used for extracting variables).
Diffstat (limited to 'tests')
-rw-r--r-- | tests/dict.test | 48 |
1 files changed, 48 insertions, 0 deletions
diff --git a/tests/dict.test b/tests/dict.test index 41c21e2..87e5107 100644 --- a/tests/dict.test +++ b/tests/dict.test @@ -1424,6 +1424,54 @@ test dict-22.17 {dict with: compiled} { array get d }} e } {e {p {q {a 2.1 b 2}}}} +test dict-22.18 {dict with: compiled} { + set ::d {a 1 b 2} + apply {{} { + dict with ::d { + set a $b.$a + } + return $::d + }} +} {a 2.1 b 2} +test dict-22.19 {dict with: compiled} { + set ::d {p {q {r {a 1 b 2}}}} + apply {{} { + dict with ::d p q r { + set a $b.$a + } + return $::d + }} +} {p {q {r {a 2.1 b 2}}}} +test dict-22.20 {dict with: compiled} { + apply {d { + dict with d { + } + return $a,$b + }} {a 1 b 2} +} 1,2 +test dict-22.21 {dict with: compiled} { + apply {d { + dict with d p q { + } + return $a,$b + }} {p {q {a 1 b 2}}} +} 1,2 +test dict-22.22 {dict with: compiled} { + set ::d {a 1 b 2} + apply {{} { + dict with ::d { + } + return $a,$b + }} +} 1,2 +test dict-22.23 {dict with: compiled} { + set ::d {p {q {a 1 b 2}}} + apply {{} { + dict with ::d p q { + } + return $a,$b + }} +} 1,2 # cleanup ::tcltest::cleanupTests |