summaryrefslogtreecommitdiffstats
path: root/tests/dict.test
diff options
context:
space:
mode:
authordkf <donal.k.fellows@manchester.ac.uk>2007-09-08 22:36:58 (GMT)
committerdkf <donal.k.fellows@manchester.ac.uk>2007-09-08 22:36:58 (GMT)
commit9759bbcba71f400d022a28af45b8fa2a2fe26cc9 (patch)
treee5d893baaa622d3fde69b26c87e513dbb2ece6c1 /tests/dict.test
parent700d951d9c38975ec0ecebf81e041ba444d0806b (diff)
downloadtcl-9759bbcba71f400d022a28af45b8fa2a2fe26cc9.zip
tcl-9759bbcba71f400d022a28af45b8fa2a2fe26cc9.tar.gz
tcl-9759bbcba71f400d022a28af45b8fa2a2fe26cc9.tar.bz2
Fix [Bug 1786481]
Diffstat (limited to 'tests/dict.test')
-rw-r--r--tests/dict.test44
1 files changed, 43 insertions, 1 deletions
diff --git a/tests/dict.test b/tests/dict.test
index c6e8987..4d3485b 100644
--- a/tests/dict.test
+++ b/tests/dict.test
@@ -9,7 +9,7 @@
# See the file "license.terms" for information on usage and redistribution
# of this file, and for a DISCLAIMER OF ALL WARRANTIES.
#
-# RCS: @(#) $Id: dict.test,v 1.20 2007/03/02 10:32:13 dkf Exp $
+# RCS: @(#) $Id: dict.test,v 1.21 2007/09/08 22:36:59 dkf Exp $
if {[lsearch [namespace children] ::tcltest] == -1} {
package require tcltest 2
@@ -1058,6 +1058,35 @@ test dict-21.15 {dict update command: compilation} {
}
dicttest {k 1 l 2}
} {}
+test dict-21.16 {dict update command: no recursive structures [Bug 1786481]} {
+ set foo {a {b {c {d {e 1}}}}}
+ dict update foo a t {
+ dict update t b t {
+ dict update t c t {
+ dict update t d t {
+ dict incr t e
+ }
+ }
+ }
+ }
+ string range [append foo OK] end-1 end
+} OK
+test dict-21.17 {dict update command: no recursive structures [Bug 1786481]} {
+ proc dicttest {} {
+ set foo {a {b {c {d {e 1}}}}}
+ dict update foo a t {
+ dict update t b t {
+ dict update t c t {
+ dict update t d t {
+ dict incr t e
+ }
+ }
+ }
+ }
+ }
+ dicttest
+ string range [append foo OK] end-1 end
+} OK
test dict-22.1 {dict with command} -body {
dict with
@@ -1127,6 +1156,19 @@ test dict-22.10 {dict with command: result handling tricky case} {
}
list $i $a
} {0 {}}
+test dict-22.11 {dict with command: no recursive structures [Bug 1786481]} {
+ set foo {t {t {t {inner 1}}}}
+ dict with foo {
+ dict with t {
+ dict with t {
+ dict with t {
+ incr inner
+ }
+ }
+ }
+ }
+ string range [append foo OK] end-1 end
+} OK
# cleanup
::tcltest::cleanupTests