summaryrefslogtreecommitdiffstats
path: root/tests/var.test
diff options
context:
space:
mode:
authorMiguel Sofer <miguel.sofer@gmail.com>2008-03-11 17:23:55 (GMT)
committerMiguel Sofer <miguel.sofer@gmail.com>2008-03-11 17:23:55 (GMT)
commit927fbda30f0ee4a5e2201dc1539f392e15a19412 (patch)
tree3f10b8bebe2f1a1dfe78dd02550643abd4c6dc38 /tests/var.test
parent032b8525dfad7e63cfb32a637325cb23af6409d6 (diff)
downloadtcl-927fbda30f0ee4a5e2201dc1539f392e15a19412.zip
tcl-927fbda30f0ee4a5e2201dc1539f392e15a19412.tar.gz
tcl-927fbda30f0ee4a5e2201dc1539f392e15a19412.tar.bz2
* generic/tclVar.c (TclDeleteNamespaceVars):
* tests/var.test (var-8.2): unset traces on vars should be called with a FQ named during namespace deletion. This was causing infinite loops when unset traces recreated the var, as reported by Julian Noble on [Bug 1911919].
Diffstat (limited to 'tests/var.test')
-rw-r--r--tests/var.test18
1 files changed, 17 insertions, 1 deletions
diff --git a/tests/var.test b/tests/var.test
index c2420ff..bf48224 100644
--- a/tests/var.test
+++ b/tests/var.test
@@ -14,7 +14,7 @@
# See the file "license.terms" for information on usage and redistribution
# of this file, and for a DISCLAIMER OF ALL WARRANTIES.
#
-# RCS: @(#) $Id: var.test,v 1.30 2007/12/13 15:26:07 dgp Exp $
+# RCS: @(#) $Id: var.test,v 1.31 2008/03/11 17:23:56 msofer Exp $
#
if {[lsearch [namespace children] ::tcltest] == -1} {
@@ -527,6 +527,22 @@ test var-8.1 {TclDeleteVars, "unset" traces are called with fully-qualified var
list [unset test_ns_var::v] $test_ns_var::info
} {{} {test_ns_var::v {} u}}
+test var-8.2 {TclDeleteNamespaceVars, "unset" traces on ns delete are called with fully-qualified var names} {
+ catch {namespace delete test_ns_var}
+ catch {unset a}
+ set info ""
+ namespace eval test_ns_var {
+ variable v 123 1
+ trace var v u ::traceUnset
+ }
+
+ proc traceUnset {name1 name2 op} {
+ set ::info [concat $::info [list $name1 $name2 $op]]
+ }
+
+ list [namespace delete test_ns_var] $::info
+} {{} {::test_ns_var::v {} u}}
+
test var-9.1 {behaviour of TclGet/SetVar simple get/set} testsetnoerr {
catch {unset u}; catch {unset v}
list \