diff options
author | msofer <msofer@noemail.net> | 2005-11-18 23:44:37 (GMT) |
---|---|---|
committer | msofer <msofer@noemail.net> | 2005-11-18 23:44:37 (GMT) |
commit | 63fb175acdbd164e7ae947c3cf6b3a017dcb3f1c (patch) | |
tree | 244c1c1a43fb25d4acd06db002e3838c15240389 | |
parent | 7eec16d25b5c416be1468236ddaa14586e2a2409 (diff) | |
download | tcl-63fb175acdbd164e7ae947c3cf6b3a017dcb3f1c.zip tcl-63fb175acdbd164e7ae947c3cf6b3a017dcb3f1c.tar.gz tcl-63fb175acdbd164e7ae947c3cf6b3a017dcb3f1c.tar.bz2 |
* tests/trace.test (trace-34.5): [Bug 1047286], added a second
test illustrating the role of "ns in callStack" in the ns's
visibility during deletion traces.
FossilOrigin-Name: 7b82e0cf5b35b8c2e93fc44792e8487621c50615
-rw-r--r-- | ChangeLog | 4 | ||||
-rw-r--r-- | tests/trace.test | 17 |
2 files changed, 19 insertions, 2 deletions
@@ -1,5 +1,9 @@ 2005-11-18 Miguel Sofer <msofer@users.sf.net> + * tests/trace.test (trace-34.5): [Bug 1047286], added a second + test illustrating the role of "ns in callStack" in the ns's + visibility during deletion traces. + * generic/tclBasic.c (Tcl_DeleteCommandFromToken): * generic/tclCmdMZ.c (TraceCommandProc): * generic/tclInt.h (NS_KILLED): diff --git a/tests/trace.test b/tests/trace.test index 91cc98b..4409fe1 100644 --- a/tests/trace.test +++ b/tests/trace.test @@ -11,7 +11,7 @@ # See the file "license.terms" for information on usage and redistribution # of this file, and for a DISCLAIMER OF ALL WARRANTIES. # -# RCS: @(#) $Id: trace.test,v 1.26.2.13 2005/11/18 23:07:27 msofer Exp $ +# RCS: @(#) $Id: trace.test,v 1.26.2.14 2005/11/18 23:44:37 msofer Exp $ if {[lsearch [namespace children] ::tcltest] == -1} { package require tcltest @@ -2267,10 +2267,12 @@ test trace-34.3 {Bug 1224585} { foo } {} +# We test here for the half-documented and currently valid interplay between +# delete traces and namespace deletion. test trace-34.4 {Bug 1047286} { variable x notrace proc callback {old - -} { - variable x "$old exists: [namespace which -command $old]" + variable x "$old exists: [namespace which -command $old]" } namespace eval ::foo {proc bar {} {}} trace add command ::foo::bar delete [namespace code callback] @@ -2278,6 +2280,17 @@ test trace-34.4 {Bug 1047286} { set x } {::foo::bar exists: ::foo::bar} +test trace-34.5 {Bug 1047286} { + variable x notrace + proc callback {old - -} { + variable x "$old exists: [namespace which -command $old]" + } + namespace eval ::foo {proc bar {} {}} + trace add command ::foo::bar delete [namespace code callback] + namespace eval ::foo namespace delete ::foo + set x +} {::foo::bar exists: } + # Delete procedures when done, so we don't clash with other tests # (e.g. foobar will clash with 'unknown' tests). catch {rename foobar {}} |