summaryrefslogtreecommitdiffstats
path: root/tests/namespace.test
diff options
context:
space:
mode:
authordgp <dgp@users.sourceforge.net>2014-02-06 22:38:17 (GMT)
committerdgp <dgp@users.sourceforge.net>2014-02-06 22:38:17 (GMT)
commit6e78f7a617b001eb5e35fe11cad2f469c0f48320 (patch)
tree1dcd49e5460f08137bd685f431b862090082fc7b /tests/namespace.test
parent4ae04fa40387165f811a88d87a1140a07bf10215 (diff)
downloadtcl-6e78f7a617b001eb5e35fe11cad2f469c0f48320.zip
tcl-6e78f7a617b001eb5e35fe11cad2f469c0f48320.tar.gz
tcl-6e78f7a617b001eb5e35fe11cad2f469c0f48320.tar.bz2
[a4494e28ed] Use flag bit instead of NULL pointer to suppress teardown list of
imported commands when the original command gets re-created. This prevents the panic otherwise possible when the invalid state represented by the NULL pointer is encountered during a command delete trace.
Diffstat (limited to 'tests/namespace.test')
-rw-r--r--tests/namespace.test9
1 files changed, 9 insertions, 0 deletions
diff --git a/tests/namespace.test b/tests/namespace.test
index 4eecac1..b59e09e 100644
--- a/tests/namespace.test
+++ b/tests/namespace.test
@@ -556,6 +556,15 @@ test namespace-13.1 {DeleteImportedCmd, deletes imported cmds} {
lappend l [info commands ::test_ns_import::*]
}
} {::test_ns_import::cmd1 {}}
+test namespace-13.2 {DeleteImportedCmd, Bug a4494e28ed} {
+ # Will panic if still buggy
+ namespace eval src {namespace export foo; proc foo {} {}}
+ namespace eval dst {namespace import [namespace parent]::src::foo}
+ trace add command src::foo delete \
+ "[list namespace delete [namespace current]::dst] ;#"
+ proc src::foo {} {}
+ namespace delete src
+} {}
test namespace-14.1 {TclGetNamespaceForQualName, absolute names} {
catch {namespace delete {*}[namespace children :: test_ns_*]}