summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authordkf <donal.k.fellows@manchester.ac.uk>2004-08-25 21:28:26 (GMT)
committerdkf <donal.k.fellows@manchester.ac.uk>2004-08-25 21:28:26 (GMT)
commitd6d4bb969fa1616d93e6a3f125308a6c386af51e (patch)
treee8d1b28362b6d5cc0cfc3043f2f0bc6dd0159501 /tests
parent6edc52fd6815d3479ca129e736b123fce6de7512 (diff)
downloadtcl-d6d4bb969fa1616d93e6a3f125308a6c386af51e.zip
tcl-d6d4bb969fa1616d93e6a3f125308a6c386af51e.tar.gz
tcl-d6d4bb969fa1616d93e6a3f125308a6c386af51e.tar.bz2
Fixes to ensemble -unknown handler processing to stop [namespace import] from
disrupting things horribly. Problem found by Don Porter when investigating [Bug 1016167].
Diffstat (limited to 'tests')
-rw-r--r--tests/namespace.test28
1 files changed, 27 insertions, 1 deletions
diff --git a/tests/namespace.test b/tests/namespace.test
index e22eb13..987741e 100644
--- a/tests/namespace.test
+++ b/tests/namespace.test
@@ -11,7 +11,7 @@
# See the file "license.terms" for information on usage and redistribution
# of this file, and for a DISCLAIMER OF ALL WARRANTIES.
#
-# RCS: @(#) $Id: namespace.test,v 1.28 2004/05/25 19:45:17 msofer Exp $
+# RCS: @(#) $Id: namespace.test,v 1.29 2004/08/25 21:28:27 dkf Exp $
if {[lsearch [namespace children] ::tcltest] == -1} {
package require tcltest 2
@@ -1649,6 +1649,32 @@ test namespace-47.6 {ensemble: unknown handler} {
while parsing result of ensemble unknown subcommand handler
invoked from within
"foo bar"}}
+test namespace-47.7 {ensemble: unknown handler and namespace import} {
+ namespace eval foo {
+ namespace export bar
+ namespace ensemble create -command bar -unknown ::foo::u -subcomm x
+ proc u {ens args} {
+ global result
+ lappend result $ens $args
+ namespace ensemble config $ens -subcommand {x y}
+ }
+ proc x args {
+ global result
+ lappend result XXX $args
+ }
+ proc y args {
+ global result
+ lappend result YYY $args
+ }
+ }
+ namespace import foo::bar
+ set result {}
+ lappend result [catch {namespace ensemble config bar} msg] $msg
+ bar x 123
+ bar y 456
+ namespace delete foo
+ set result
+} {1 {bar is not an ensemble command} XXX 123 ::bar {y 456} YYY 456}
# cleanup
catch {rename cmd1 {}}