summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authordgp <dgp@users.sourceforge.net>2018-04-17 18:34:41 (GMT)
committerdgp <dgp@users.sourceforge.net>2018-04-17 18:34:41 (GMT)
commitf316d7539c5bb69dc519fc27be251c9ba056c189 (patch)
tree3dfa7e24db73d9b169bbd9b276efc74cb59ceb59 /tests
parent05845fbe5f778520cb2a60420a657d9b21de83b7 (diff)
downloadtcl-f316d7539c5bb69dc519fc27be251c9ba056c189.zip
tcl-f316d7539c5bb69dc519fc27be251c9ba056c189.tar.gz
tcl-f316d7539c5bb69dc519fc27be251c9ba056c189.tar.bz2
[array set] must fire array traces. Don't disrupt that by reporting argument
errors too early.
Diffstat (limited to 'tests')
-rw-r--r--tests/var.test9
1 files changed, 9 insertions, 0 deletions
diff --git a/tests/var.test b/tests/var.test
index a9d93ac..d1340f6 100644
--- a/tests/var.test
+++ b/tests/var.test
@@ -930,6 +930,15 @@ test var-20.9 {[bc1a96407a] array set compiled w/ trace} -setup {
test var-20.10 {[bc1a96407a] array set don't compile bad varname} -body {
apply {{} {set name foo(bar); array set $name {a 1}}}
} -returnCodes error -match glob -result *
+test var-20.11 {array set don't compile bad initializer} -setup {
+ unset -nocomplain foo
+ trace add variable foo array {set foo(bar) baz;#}
+} -body {
+ catch {array set foo bad}
+ set foo(bar)
+} -cleanup {
+ unset -nocomplain foo
+} -result baz
test var-21.0 {PushVarNameWord OBOE in compiled unset} -setup {
proc linenumber {} {dict get [info frame -1] line}