diff options
author | dkf <donal.k.fellows@manchester.ac.uk> | 2016-07-16 11:42:38 (GMT) |
---|---|---|
committer | dkf <donal.k.fellows@manchester.ac.uk> | 2016-07-16 11:42:38 (GMT) |
commit | 9015a7b063d96172512c54d84395d2b260d4d330 (patch) | |
tree | 496ba817c4349a54ac3274bcb6e34967dcbbf24e /tests/namespace.test | |
parent | cbd642eea303b0db3eec81529c27f2045984f22a (diff) | |
download | tcl-9015a7b063d96172512c54d84395d2b260d4d330.zip tcl-9015a7b063d96172512c54d84395d2b260d4d330.tar.gz tcl-9015a7b063d96172512c54d84395d2b260d4d330.tar.bz2 |
[77d58e3a7a] Test case independence: io, load, msgcat, namespace, safe.
Diffstat (limited to 'tests/namespace.test')
-rw-r--r-- | tests/namespace.test | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/tests/namespace.test b/tests/namespace.test index 55505f1..de7009d 100644 --- a/tests/namespace.test +++ b/tests/namespace.test @@ -846,6 +846,7 @@ test namespace-17.1 {Tcl_FindNamespaceVar, absolute name found} -setup { set ::x } } -result {314159} +variable ::x 314159 test namespace-17.2 {Tcl_FindNamespaceVar, absolute name found} { namespace eval test_ns_1 { variable x 777 @@ -889,23 +890,25 @@ test namespace-17.6 {Tcl_FindNamespaceVar, relative name found} -setup { } -result {777} test namespace-17.7 {Tcl_FindNamespaceVar, relative name found} { namespace eval test_ns_1 { + variable x 777 unset x set x ;# must be global x now } } {314159} -test namespace-17.8 {Tcl_FindNamespaceVar, relative name not found} { +test namespace-17.8 {Tcl_FindNamespaceVar, relative name not found} -body { namespace eval test_ns_1 { - list [catch {set wuzzat} msg] $msg + set wuzzat } -} {1 {can't read "wuzzat": no such variable}} +} -returnCodes error -result {can't read "wuzzat": no such variable} test namespace-17.9 {Tcl_FindNamespaceVar, relative name and TCL_GLOBAL_ONLY} { namespace eval test_ns_1 { variable a hello } set test_ns_1::a } {hello} -test namespace-17.10 {Tcl_FindNamespaceVar, interference with cached varNames} { +test namespace-17.10 {Tcl_FindNamespaceVar, interference with cached varNames} -setup { namespace eval test_ns_1 {} +} -body { proc test_ns {} { set ::test_ns_1::a 0 } @@ -916,7 +919,7 @@ test namespace-17.10 {Tcl_FindNamespaceVar, interference with cached varNames} { namespace eval test_ns_1 set a 1 namespace delete test_ns_1 return $a -} 1 +} -result 1 catch {unset a} catch {unset x} |