diff options
Diffstat (limited to 'tests/misc.test')
-rw-r--r-- | tests/misc.test | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/tests/misc.test b/tests/misc.test index f9a2de7..f259185 100644 --- a/tests/misc.test +++ b/tests/misc.test @@ -338,4 +338,32 @@ test parsevar-1.1 "Variables should include double colons" { set x } 2 +test sharing-1.1 "Problems with ref sharing in arrays: lappend" { + set a {a 1 c 2} + set b $a + lappend b(c) 3 + set a(c) +} 2 + +test sharing-1.2 "Problems with ref sharing in arrays: append" { + set a {a 1 c 2} + set b $a + append b(c) 3 + set a(c) +} 2 + +test sharing-1.3 "Problems with ref sharing in arrays: incr" { + set a {a 1 c 2} + set b $a + incr b(c) + set a(c) +} 2 + +test sharing-1.4 "Problems with ref sharing in arrays: lset" { + set a {a 1 c {2 3}} + set b $a + lset b(c) 1 x + set a(c) +} {2 3} + testreport |