diff options
author | welch <welch> | 1998-08-10 15:52:50 (GMT) |
---|---|---|
committer | welch <welch> | 1998-08-10 15:52:50 (GMT) |
commit | 69609d1d8359133ff6b3af41b04d88b58cfbc340 (patch) | |
tree | 918caa413009fa4b2fc124389e85f0d47e6f10c2 /tests/namespace.test | |
parent | c46637e50d338911d0440d799a32fdc9903bec16 (diff) | |
download | tcl-69609d1d8359133ff6b3af41b04d88b58cfbc340.zip tcl-69609d1d8359133ff6b3af41b04d88b58cfbc340.tar.gz tcl-69609d1d8359133ff6b3af41b04d88b58cfbc340.tar.bz2 |
Added test for namespace import fix
Diffstat (limited to 'tests/namespace.test')
-rw-r--r-- | tests/namespace.test | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/tests/namespace.test b/tests/namespace.test index e876391..0b9a2b5 100644 --- a/tests/namespace.test +++ b/tests/namespace.test @@ -222,6 +222,23 @@ test namespace-9.6 {Tcl_Import, cmd redefinition ok if allowOverwrite!=0} { cmd1 555 } } {cmd1: 555} +test namespace-9.7 {Tcl_Import, links are preserved if cmd is redefined} { + catch {eval namespace delete [namespace children :: test_ns_*]} + namespace eval test_ns_export { + namespace export cmd1 + proc cmd1 {args} {return "cmd1: $args"} + } + namespace eval test_ns_import { + namespace import -force ::test_ns_export::* + } + list [test_ns_import::cmd1 a b c] \ + [test_ns_export::cmd1 d e f] \ + [proc test_ns_export::cmd1 {args} {return "new1: $args"}] \ + [namespace origin test_ns_import::cmd1] \ + [namespace origin test_ns_export::cmd1] \ + [test_ns_import::cmd1 g h i] \ + [test_ns_export::cmd1 j k l] +} {{cmd1: a b c} {cmd1: d e f} {} ::test_ns_export::cmd1 ::test_ns_export::cmd1 {new1: g h i} {new1: j k l}} test namespace-10.1 {Tcl_ForgetImport, check for valid namespaces} { catch {eval namespace delete [namespace children :: test_ns_*]} |