diff options
author | dgp <dgp@users.sourceforge.net> | 2018-04-19 01:39:38 (GMT) |
---|---|---|
committer | dgp <dgp@users.sourceforge.net> | 2018-04-19 01:39:38 (GMT) |
commit | df94eecf119611a2fa8de1abb3abe59269be7550 (patch) | |
tree | 20e9d2ee27278c74ce9326bb1f54b69767315921 /tests | |
parent | 80e5aed49e2cac237b9d91db0f5dc1139c6462dd (diff) | |
download | tcl-df94eecf119611a2fa8de1abb3abe59269be7550.zip tcl-df94eecf119611a2fa8de1abb3abe59269be7550.tar.gz tcl-df94eecf119611a2fa8de1abb3abe59269be7550.tar.bz2 |
An [array set] from a dict can only take shortcuts when the dict is "pure",
that is, has no string rep.
Diffstat (limited to 'tests')
-rw-r--r-- | tests/var.test | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/tests/var.test b/tests/var.test index 30e340e..aadeb34 100644 --- a/tests/var.test +++ b/tests/var.test @@ -761,6 +761,18 @@ test var-17.1 {TclArraySet [Bug 1669489]} -setup { } -cleanup { unset -nocomplain ::a ::elements } -result {} +test var-17.2 {TclArraySet Dict shortcut only on pure value} -setup { + unset -nocomplain a d + set d {p 1 p 2} + dict get $d p + set foo 0 +} -body { + trace add variable a write "[list incr [namespace which -variable foo]];#" + array set a $d + set foo +} -cleanup { + unset -nocomplain a d foo +} -result 2 test var-18.1 {array unset and unset traces: Bug 2939073} -setup { set already 0 |