summaryrefslogtreecommitdiffstats
path: root/tests/proc.test
diff options
context:
space:
mode:
Diffstat (limited to 'tests/proc.test')
-rw-r--r--tests/proc.test34
1 files changed, 17 insertions, 17 deletions
diff --git a/tests/proc.test b/tests/proc.test
index ce07e88..bf23ef7 100644
--- a/tests/proc.test
+++ b/tests/proc.test
@@ -13,20 +13,20 @@
# See the file "license.terms" for information on usage and redistribution
# of this file, and for a DISCLAIMER OF ALL WARRANTIES.
#
-# RCS: @(#) $Id: proc.test,v 1.11 2002/12/11 21:29:52 dgp Exp $
+# RCS: @(#) $Id: proc.test,v 1.12 2003/11/14 20:44:47 dgp Exp $
if {[lsearch [namespace children] ::tcltest] == -1} {
package require tcltest
namespace import -force ::tcltest::*
}
-catch {eval namespace delete [namespace children :: test_ns_*]}
+catch {namespace delete {expand}[namespace children :: test_ns_*]}
catch {rename p ""}
catch {rename {} ""}
catch {unset msg}
test proc-1.1 {Tcl_ProcObjCmd, put proc in namespace specified in name, if any} {
- catch {eval namespace delete [namespace children :: test_ns_*]}
+ catch {namespace delete {expand}[namespace children :: test_ns_*]}
namespace eval test_ns_1 {
namespace eval baz {}
}
@@ -38,11 +38,11 @@ test proc-1.1 {Tcl_ProcObjCmd, put proc in namespace specified in name, if any}
[info commands test_ns_1::baz::*]
} {{p in ::test_ns_1::baz} {p in ::test_ns_1::baz} ::test_ns_1::baz::p}
test proc-1.2 {Tcl_ProcObjCmd, namespace specified in proc name must exist} {
- catch {eval namespace delete [namespace children :: test_ns_*]}
+ catch {namespace delete {expand}[namespace children :: test_ns_*]}
list [catch {proc test_ns_1::baz::p {} {}} msg] $msg
} {1 {can't create procedure "test_ns_1::baz::p": unknown namespace}}
test proc-1.3 {Tcl_ProcObjCmd, empty proc name} {
- catch {eval namespace delete [namespace children :: test_ns_*]}
+ catch {namespace delete {expand}[namespace children :: test_ns_*]}
proc :: {} {
return "empty called"
}
@@ -52,7 +52,7 @@ test proc-1.3 {Tcl_ProcObjCmd, empty proc name} {
return "empty called"
}}
test proc-1.4 {Tcl_ProcObjCmd, simple proc name and proc defined in namespace} {
- catch {eval namespace delete [namespace children :: test_ns_*]}
+ catch {namespace delete {expand}[namespace children :: test_ns_*]}
namespace eval test_ns_1 {
namespace eval baz {
proc p {} {
@@ -64,7 +64,7 @@ test proc-1.4 {Tcl_ProcObjCmd, simple proc name and proc defined in namespace} {
[info commands test_ns_1::baz::*]
} {{p in ::test_ns_1::baz} ::test_ns_1::baz::p}
test proc-1.5 {Tcl_ProcObjCmd, qualified proc name and proc defined in namespace} {
- catch {eval namespace delete [namespace children :: test_ns_*]}
+ catch {namespace delete {expand}[namespace children :: test_ns_*]}
namespace eval test_ns_1::baz {}
namespace eval test_ns_1 {
proc baz::p {} {
@@ -76,7 +76,7 @@ test proc-1.5 {Tcl_ProcObjCmd, qualified proc name and proc defined in namespace
[namespace eval test_ns_1::baz {namespace which p}]
} {{p in ::test_ns_1::baz} ::test_ns_1::baz::p ::test_ns_1::baz::p}
test proc-1.6 {Tcl_ProcObjCmd, namespace code ignores single ":"s in middle or end of command names} {
- catch {eval namespace delete [namespace children :: test_ns_*]}
+ catch {namespace delete {expand}[namespace children :: test_ns_*]}
namespace eval test_ns_1 {
proc q: {} {return "q:"}
proc value:at: {} {return "value:at:"}
@@ -103,13 +103,13 @@ test proc-1.8 {Tcl_ProcObjCmd, check that formal parameter names are simple name
} {1 {procedure "p" has formal parameter "b::a" that is not a simple name}}
test proc-2.1 {TclFindProc, simple proc name and proc not in namespace} {
- catch {eval namespace delete [namespace children :: test_ns_*]}
+ catch {namespace delete {expand}[namespace children :: test_ns_*]}
catch {rename p ""}
proc p {} {return "p in [namespace current]"}
info body p
} {return "p in [namespace current]"}
test proc-2.2 {TclFindProc, simple proc name and proc defined in namespace} {
- catch {eval namespace delete [namespace children :: test_ns_*]}
+ catch {namespace delete {expand}[namespace children :: test_ns_*]}
namespace eval test_ns_1 {
namespace eval baz {
proc p {} {return "p in [namespace current]"}
@@ -118,7 +118,7 @@ test proc-2.2 {TclFindProc, simple proc name and proc defined in namespace} {
namespace eval test_ns_1::baz {info body p}
} {return "p in [namespace current]"}
test proc-2.3 {TclFindProc, qualified proc name and proc defined in namespace} {
- catch {eval namespace delete [namespace children :: test_ns_*]}
+ catch {namespace delete {expand}[namespace children :: test_ns_*]}
namespace eval test_ns_1::baz {}
namespace eval test_ns_1 {
proc baz::p {} {return "p in [namespace current]"}
@@ -126,26 +126,26 @@ test proc-2.3 {TclFindProc, qualified proc name and proc defined in namespace} {
namespace eval test_ns_1 {info body baz::p}
} {return "p in [namespace current]"}
test proc-2.4 {TclFindProc, global proc and executing in namespace} {
- catch {eval namespace delete [namespace children :: test_ns_*]}
+ catch {namespace delete {expand}[namespace children :: test_ns_*]}
catch {rename p ""}
proc p {} {return "global p"}
namespace eval test_ns_1::baz {info body p}
} {return "global p"}
test proc-3.1 {TclObjInterpProc, proc defined and executing in same namespace} {
- catch {eval namespace delete [namespace children :: test_ns_*]}
+ catch {namespace delete {expand}[namespace children :: test_ns_*]}
proc p {} {return "p in [namespace current]"}
p
} {p in ::}
test proc-3.2 {TclObjInterpProc, proc defined and executing in same namespace} {
- catch {eval namespace delete [namespace children :: test_ns_*]}
+ catch {namespace delete {expand}[namespace children :: test_ns_*]}
namespace eval test_ns_1::baz {
proc p {} {return "p in [namespace current]"}
p
}
} {p in ::test_ns_1::baz}
test proc-3.3 {TclObjInterpProc, proc defined and executing in different namespaces} {
- catch {eval namespace delete [namespace children :: test_ns_*]}
+ catch {namespace delete {expand}[namespace children :: test_ns_*]}
catch {rename p ""}
proc p {} {return "p in [namespace current]"}
namespace eval test_ns_1::baz {
@@ -153,7 +153,7 @@ test proc-3.3 {TclObjInterpProc, proc defined and executing in different namespa
}
} {p in ::}
test proc-3.4 {TclObjInterpProc, procs execute in the namespace in which they were defined unless renamed into new namespace} {
- catch {eval namespace delete [namespace children :: test_ns_*]}
+ catch {namespace delete {expand}[namespace children :: test_ns_*]}
catch {rename p ""}
namespace eval test_ns_1::baz {
proc p {} {return "p in [namespace current]"}
@@ -166,7 +166,7 @@ test proc-3.5 {TclObjInterpProc, any old result is reset before appending error
list [catch {p} msg] $msg
} {1 {wrong # args: should be "p x"}}
-catch {eval namespace delete [namespace children :: test_ns_*]}
+catch {namespace delete {expand}[namespace children :: test_ns_*]}
catch {rename p ""}
catch {rename {} ""}
catch {unset msg}