From f32a30e09c8e10a9cad9028e8830694056f71d62 Mon Sep 17 00:00:00 2001 From: Miguel Sofer Date: Sun, 29 Oct 2006 21:40:42 +0000 Subject: * generic/tclNamesp.c (EnsembleImplementationCmd): * tests/namespace.test (47.7-8): reverted a wrong "optimisation" that completely broke snit; added two tests. --- ChangeLog | 6 ++++++ generic/tclNamesp.c | 4 ++-- tests/namespace.test | 20 +++++++++++++++++++- 3 files changed, 27 insertions(+), 3 deletions(-) diff --git a/ChangeLog b/ChangeLog index 95c6e6c..477899f 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2006-10-26 Miguel Sofer + + * generic/tclNamesp.c (EnsembleImplementationCmd): + * tests/namespace.test (47.7-8): reverted a wrong "optimisation" + that completely broke snit; added two tests. + 2006-10-28 Donal K. Fellows * generic/tclProc.c (ObjInterpProcEx, TclObjInterpProcCore): Split the diff --git a/generic/tclNamesp.c b/generic/tclNamesp.c index 040e723..670ae83 100644 --- a/generic/tclNamesp.c +++ b/generic/tclNamesp.c @@ -22,7 +22,7 @@ * See the file "license.terms" for information on usage and redistribution * of this file, and for a DISCLAIMER OF ALL WARRANTIES. * - * RCS: @(#) $Id: tclNamesp.c,v 1.108 2006/10/28 18:09:11 dkf Exp $ + * RCS: @(#) $Id: tclNamesp.c,v 1.109 2006/10/29 21:40:43 msofer Exp $ */ #include "tclInt.h" @@ -6297,7 +6297,7 @@ NsEnsembleImplementationCmd( int paramc, i; Tcl_Obj **paramv, *unknownCmd, *ensObj; - unknownCmd = Tcl_NewListObj(1, &ensemblePtr->unknownHandler); + unknownCmd = Tcl_DuplicateObj(ensemblePtr->unknownHandler); TclNewObj(ensObj); Tcl_GetCommandFullName(interp, ensemblePtr->token, ensObj); Tcl_ListObjAppendElement(NULL, unknownCmd, ensObj); diff --git a/tests/namespace.test b/tests/namespace.test index 2bc0f04..a655c9c 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.59 2006/10/23 22:49:26 msofer Exp $ +# RCS: @(#) $Id: namespace.test,v 1.60 2006/10/29 21:40:43 msofer Exp $ if {[lsearch [namespace children] ::tcltest] == -1} { package require tcltest 2 @@ -1889,6 +1889,24 @@ 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, commands with spaces} { + namespace ensemble create -command foo -unknown bar + proc bar {args} { + list ::set ::x [join $args |] + } + set result [foo {one two three}] + rename foo {} + set result +} {::foo|one two three} +test namespace-47.8 {ensemble: unknown handler, commands with spaces} { + namespace ensemble create -command foo -unknown {bar boo} + proc bar {args} { + list ::set ::x [join $args |] + } + set result [foo {one two three}] + rename foo {} + set result +} {boo|::foo|one two three} test namespace-48.1 {ensembles and namespace import: unknown handler} { namespace eval foo { -- cgit v0.12