From d9bbe48c46c61ced3aff0579f622fb0a180e19fa Mon Sep 17 00:00:00 2001 From: pooryorick Date: Mon, 17 May 2021 21:29:25 +0000 Subject: Additional test for [688fcc7082fa99a4]. --- tests/namespace.test | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) diff --git a/tests/namespace.test b/tests/namespace.test index 8209cf3..ed52102 100644 --- a/tests/namespace.test +++ b/tests/namespace.test @@ -3340,6 +3340,38 @@ test namespace-56.5 {Bug 8b9854c3d8} -setup { } -result 1 +test namespace-56.6 { + Namespace deletion traces on both the original routine and the imported + routine should run without any memory error under a debug build. +} -body { + variable res 0 + + proc ondelete {old new op} { + $old + } + + namespace eval ns1 {} { + namespace export * + proc p1 {} { + namespace upvar [namespace parent] res res + incr res + } + trace add command p1 delete ondelete + } + + namespace eval ns2 {} { + namespace import ::ns1::p1 + trace add command p1 delete ondelete + } + + namespace delete ns1 + namespace delete ns2 + return $res +} -cleanup { + unset res + rename ondelete {} +} -result 2 + test namespace-57.0 { an imported alias should be usable in the deletion trace for the alias -- cgit v0.12