diff options
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 |