summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorpooryorick <com.digitalsmarties@pooryorick.com>2020-08-10 18:05:10 (GMT)
committerpooryorick <com.digitalsmarties@pooryorick.com>2020-08-10 18:05:10 (GMT)
commite29e808f57505a56193de6e0717c7abe95755b03 (patch)
tree3a9dc4b64ea48ddec33f65474dad7bedc344dae7 /tests
parent6c0be70d2b1cc5dbfd1277556ac27ea2e39be4bb (diff)
downloadtcl-e29e808f57505a56193de6e0717c7abe95755b03.zip
tcl-e29e808f57505a56193de6e0717c7abe95755b03.tar.gz
tcl-e29e808f57505a56193de6e0717c7abe95755b03.tar.bz2
Fix for [29e8848eb976], imported alias in a deletion trace.
Diffstat (limited to 'tests')
-rw-r--r--tests/namespace.test43
1 files changed, 43 insertions, 0 deletions
diff --git a/tests/namespace.test b/tests/namespace.test
index dd71697..796b46b 100644
--- a/tests/namespace.test
+++ b/tests/namespace.test
@@ -3337,6 +3337,49 @@ test namespace-56.5 {Bug 8b9854c3d8} -setup {
namespace delete namespace-56.5
} -result 1
+
+
+test namespace-57.0 {
+ an imported alias should be usable in the deletion trace for the alias
+
+ see 29e8848eb976
+} -body {
+ variable res {}
+ namespace eval ns2 {
+ namespace export *
+ proc p1 {oldname newname op} {
+ return success
+ }
+
+ interp alias {} [namespace current]::p2 {} [namespace which p1]
+ }
+
+
+ namespace eval ns3 {
+ namespace import ::ns2::p2
+ }
+
+
+ set ondelete [list apply [list {oldname newname op} {
+ variable res
+ catch {
+ ns3::p2 $oldname $newname $op
+ } cres
+ lappend res $cres
+ } [namespace current]]]
+
+
+ trace add command ::ns2::p2 delete $ondelete
+ rename ns2::p2 {}
+ return $res
+} -cleanup {
+ unset res
+ namespace delete ns2
+ namespace delete ns3
+} -result success
+
+
+
# cleanup
catch {rename cmd1 {}}