diff options
author | jan.nijtmans <nijtmans@users.sourceforge.net> | 2020-09-05 21:33:49 (GMT) |
---|---|---|
committer | jan.nijtmans <nijtmans@users.sourceforge.net> | 2020-09-05 21:33:49 (GMT) |
commit | dcac12df7b84f7405d359c29f503ca9f3b8bbba4 (patch) | |
tree | fc7a3f45cef9a2370191f49217d52f8701daba92 /tests/namespace.test | |
parent | 44e65c02be950f03549e7a2bcc02a32e23e4dc42 (diff) | |
download | tcl-dcac12df7b84f7405d359c29f503ca9f3b8bbba4.zip tcl-dcac12df7b84f7405d359c29f503ca9f3b8bbba4.tar.gz tcl-dcac12df7b84f7405d359c29f503ca9f3b8bbba4.tar.bz2 |
Backout [c1a376375e0e6488]: imported namespace ensemble command name distorted during deletion trace on the import.
According to Travis, there's a memory leak which needs to be fixed first.
Diffstat (limited to 'tests/namespace.test')
-rw-r--r-- | tests/namespace.test | 96 |
1 files changed, 0 insertions, 96 deletions
diff --git a/tests/namespace.test b/tests/namespace.test index d09a853..8209cf3 100644 --- a/tests/namespace.test +++ b/tests/namespace.test @@ -618,102 +618,6 @@ test namespace-13.2 {DeleteImportedCmd, Bug a4494e28ed} { namespace delete src } {} - -test namespace-13.3 { - deleting origin of import in trace on deletion of import -} -setup { - namespace eval ns0 { - namespace export * - variable res {} - - proc traced {oldname newname op} { - variable res - - lappend res {Is oldname the name of the imported routine?} - set expected [namespace qualifiers [namespace current]::fake]::ns2::ns1 - if {$oldname eq $expected} { - lappend res 1 - } else { - lappend res 0 - } - - lappend res {[namespace which] finds the old name} - set which [namespace which $oldname] - if {$which eq $expected} { - lappend res 1 - } else { - lappend res $which - } - - lappend res {Is origin name correct} - catch { - namespace origin $oldname - } cres copts - set expected [namespace qualifiers [namespace current]::fake]::ns1 - if {$cres eq $expected} { - lappend res 1 - } else { - lappend res $cres - } - - set origin $cres - rename $origin {} - - lappend res {After deletion of the origin is it an error to ask for the origin (compiled)?} - set status [catch { - namespace origin $oldname - } cres copts] - if {$status && [string match {invalid command name "*::ns2::ns1"} $cres]} { - lappend res 1 - } else { - lappend res $cres - } - - lappend res {After deletion of the origin is it an error to ask for the origin (uncompiled)?} - set status [catch { - namespace eval [namespace current] "namespace origin $oldname" - } cres copts] - if {$status && [string match {invalid command name "*::ns2::ns1"} $cres]} { - lappend res 1 - } else { - lappend res $cres - } - - lappend res {after deletion of origin, [namespace which] on the imported routine returns the empty string} - set which [namespace which $oldname] - if {$which eq {}} { - lappend res 1 - } else { - lappend res $which - } - - return - } - - } -} -body { - namespace eval ns0::ns1 { - namespace ensemble create - } - - namespace eval ns0::ns2 { - namespace import [namespace parent]::ns1 - trace add command ns1 delete [namespace parent]::traced - rename ns1 {} - } - return $ns0::res -} -cleanup { - namespace delete ns0 -} -result [list \ - {Is oldname the name of the imported routine?} 1 \ - {[namespace which] finds the old name} 1 \ - {Is origin name correct} 1 \ - {After deletion of the origin is it an error to ask for the origin (compiled)?} 1 \ - {After deletion of the origin is it an error to ask for the origin (uncompiled)?} 1 \ - {after deletion of origin, [namespace which] on the imported routine returns the empty string} 1 \ -] - - test namespace-14.1 {TclGetNamespaceForQualName, absolute names} -setup { catch {namespace delete {*}[namespace children :: test_ns_*]} variable v 10 |