summaryrefslogtreecommitdiffstats
path: root/tests/basic.test
diff options
context:
space:
mode:
authordgp <dgp@users.sourceforge.net>2013-02-25 14:55:17 (GMT)
committerdgp <dgp@users.sourceforge.net>2013-02-25 14:55:17 (GMT)
commit1f5b1659347a5cb0b2f887b5f3b8c5e9221e3997 (patch)
tree9455396a4e9d2cd847e2d897472613c4b1b8f072 /tests/basic.test
parentca5848b9fa59cb04251c5ab99327e8572cdab06d (diff)
parent597760fa003d1d510853e15a4c74b3ffd70b3e98 (diff)
downloadtcl-1f5b1659347a5cb0b2f887b5f3b8c5e9221e3997.zip
tcl-1f5b1659347a5cb0b2f887b5f3b8c5e9221e3997.tar.gz
tcl-1f5b1659347a5cb0b2f887b5f3b8c5e9221e3997.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 ""}