summaryrefslogtreecommitdiffstats
path: root/tests/basic.test
diff options
context:
space:
mode:
authordgp@users.sourceforge.net <dgp>2013-02-25 14:55:17 (GMT)
committerdgp@users.sourceforge.net <dgp>2013-02-25 14:55:17 (GMT)
commit317d24b51f1c5553e3a4af0fbff8f55a187d2f80 (patch)
tree9455396a4e9d2cd847e2d897472613c4b1b8f072 /tests/basic.test
parent971bfcaadf4e78d8cca1e2037c120953ec455d77 (diff)
parent8134de3afa646c21024098a7920a85f42a7957d7 (diff)
downloadtcl-317d24b51f1c5553e3a4af0fbff8f55a187d2f80.zip
tcl-317d24b51f1c5553e3a4af0fbff8f55a187d2f80.tar.gz
tcl-317d24b51f1c5553e3a4af0fbff8f55a187d2f80.tar.bz2
3605719,3605720 Test independence. Thanks Rolf Ade for patches.
Diffstat (limited to 'tests/basic.test')
-rw-r--r--tests/basic.test14
1 files changed, 12 insertions, 2 deletions
diff --git a/tests/basic.test b/tests/basic.test
index ccf26cc..1a0037c 100644
--- a/tests/basic.test
+++ b/tests/basic.test
@@ -267,14 +267,24 @@ test basic-18.4 {TclRenameCommand, bad new name} {
}
rename test_ns_basic::p :::george::martha
} {}
-test basic-18.5 {TclRenameCommand, new name must not already exist} {
+test basic-18.5 {TclRenameCommand, new name must not already exist} -setup {
+ if {![llength [info commands :::george::martha]]} {
+ catch {namespace delete {*}[namespace children :: test_ns_*]}
+ namespace eval test_ns_basic {
+ proc p {} {
+ return "p in [namespace current]"
+ }
+ }
+ rename test_ns_basic::p :::george::martha
+ }
+} -body {
namespace eval test_ns_basic {
proc q {} {
return 42
}
}
list [catch {rename test_ns_basic::q :::george::martha} msg] $msg
-} {1 {can't rename to ":::george::martha": command already exists}}
+} -result {1 {can't rename to ":::george::martha": command already exists}}
test basic-18.6 {TclRenameCommand, check for command shadowing by newly renamed cmd} {
catch {namespace delete {*}[namespace children :: test_ns_*]}
catch {rename p ""}