summaryrefslogtreecommitdiffstats
path: root/tests/interp.test
diff options
context:
space:
mode:
authorpooryorick <com.digitalsmarties@pooryorick.com>2020-08-12 13:31:16 (GMT)
committerpooryorick <com.digitalsmarties@pooryorick.com>2020-08-12 13:31:16 (GMT)
commit80c4d66b217ec43299960d17a40f07d4cfd870bf (patch)
tree0f704c01a628cb9a92fd7351b29dd7449ff1b814 /tests/interp.test
parent1d4f551278f3f36f063591ecc1a6bd2e7964b14f (diff)
downloadtcl-80c4d66b217ec43299960d17a40f07d4cfd870bf.zip
tcl-80c4d66b217ec43299960d17a40f07d4cfd870bf.tar.gz
tcl-80c4d66b217ec43299960d17a40f07d4cfd870bf.tar.bz2
body of test case for [3422267ed6b79922].
Diffstat (limited to 'tests/interp.test')
-rw-r--r--tests/interp.test30
1 files changed, 30 insertions, 0 deletions
diff --git a/tests/interp.test b/tests/interp.test
index 35f3390..9287756 100644
--- a/tests/interp.test
+++ b/tests/interp.test
@@ -3668,6 +3668,36 @@ test interp-38.8 {interp debug basic setup} -body {
test interp-39.0 {
no segmentation fault when a command is deleted
} -body {
+ variable res {}
+
+ proc p1 args {
+ return success
+ }
+ namespace eval ns1 {
+ namespace export *
+ }
+ interp alias {} [namespace current]::ns1::p2 {} [namespace current]::p1
+ namespace eval ns2 {
+ namespace import [namespace parent]::ns1::p2
+ }
+ proc ondelete {oldname newname op} {
+ variable res
+ namespace delete ns1
+ catch {
+ ns1::p2
+ } res
+ }
+
+ trace add command ns2::p2 delete [namespace which ondelete]
+ rename ns2::p2 {}
+ rename p1 {}
+ if {
+ [string match {*invalid command name*ns1::p2*} $res]
+ } {
+ return 1
+ } else {
+ return $res
+ }
} -cleanup {
} -result 1