diff options
author | dgp <dgp@users.sourceforge.net> | 2013-02-25 14:54:14 (GMT) |
---|---|---|
committer | dgp <dgp@users.sourceforge.net> | 2013-02-25 14:54:14 (GMT) |
commit | 597760fa003d1d510853e15a4c74b3ffd70b3e98 (patch) | |
tree | 8cb62dfef73aa410f137214e343654d9d065d6ca /tests/basic.test | |
parent | c321250dcd5875ebaf9503f4278e9c1f6a3ca30c (diff) | |
download | tcl-597760fa003d1d510853e15a4c74b3ffd70b3e98.zip tcl-597760fa003d1d510853e15a4c74b3ffd70b3e98.tar.gz tcl-597760fa003d1d510853e15a4c74b3ffd70b3e98.tar.bz2 |
3605719,3605720 Test independence. Thanks Rolf Ade for patches.
Diffstat (limited to 'tests/basic.test')
-rw-r--r-- | tests/basic.test | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/tests/basic.test b/tests/basic.test index 0bad4ed..91e4d6c 100644 --- a/tests/basic.test +++ b/tests/basic.test @@ -264,14 +264,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 ""} |