diff options
author | Steve Bennett <steveb@workware.net.au> | 2023-02-24 12:59:56 +1000 |
---|---|---|
committer | Steve Bennett <steveb@workware.net.au> | 2023-02-24 13:02:31 +1000 |
commit | 7eb6fdddafb7ee98afd8dc170a23bfbb32708994 (patch) | |
tree | 9cfdb2dc8baffea9d0c58286b06be4c3c550f62d /tests/dict.test | |
parent | 23603d8c3d482a9f92a949c9da1c71a0c8e68343 (diff) | |
download | jimtcl-7eb6fdddafb7ee98afd8dc170a23bfbb32708994.zip jimtcl-7eb6fdddafb7ee98afd8dc170a23bfbb32708994.tar.gz jimtcl-7eb6fdddafb7ee98afd8dc170a23bfbb32708994.tar.bz2 |
dict with: return script result
Previously dict with returned the new dict value.
Also fix an issue in the case where a dict element
mirrors the name of the dictionary.
Fixes: #241
Signed-off-by: Steve Bennett <steveb@workware.net.au>
Diffstat (limited to 'tests/dict.test')
-rw-r--r-- | tests/dict.test | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/tests/dict.test b/tests/dict.test index f77d95e..0c2c395 100644 --- a/tests/dict.test +++ b/tests/dict.test @@ -114,6 +114,18 @@ test dict-5.2 {Dict with} { } dictsort [a] } {a B} +test dict-5.3 {Dict with return value} { + proc a {} { + set x [dict create a b c d] + dict with x { + set a B + unset c + # dict with should return the script return value + set retvalue ok + } + } + a +} {ok} test dict-22.1 {dict with command} { list [catch {dict with} msg] $msg |