summaryrefslogtreecommitdiffstats
path: root/tests/namespace.test
diff options
context:
space:
mode:
authorwelch <welch@noemail.net>1998-08-10 15:52:49 (GMT)
committerwelch <welch@noemail.net>1998-08-10 15:52:49 (GMT)
commitb3f578e4231320b7853daa10d897064fd9357e0f (patch)
tree918caa413009fa4b2fc124389e85f0d47e6f10c2 /tests/namespace.test
parentf167a3d7b0c1a4ed6d2eee6715cfa46cf36dbe6a (diff)
downloadtcl-b3f578e4231320b7853daa10d897064fd9357e0f.zip
tcl-b3f578e4231320b7853daa10d897064fd9357e0f.tar.gz
tcl-b3f578e4231320b7853daa10d897064fd9357e0f.tar.bz2
Added test for namespace import fix
FossilOrigin-Name: 1f8732924704816b16b4cf05e75c1ad4c2a655c2
Diffstat (limited to 'tests/namespace.test')
-rw-r--r--tests/namespace.test17
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_*]}