diff options
author | Miguel Sofer <miguel.sofer@gmail.com> | 2006-10-29 21:40:42 (GMT) |
---|---|---|
committer | Miguel Sofer <miguel.sofer@gmail.com> | 2006-10-29 21:40:42 (GMT) |
commit | f32a30e09c8e10a9cad9028e8830694056f71d62 (patch) | |
tree | 086d76a57a761fc5a658ba42f358f506869efdd0 | |
parent | fc1ced4682dfd72cfa8fc82268206e50522eff95 (diff) | |
download | tcl-f32a30e09c8e10a9cad9028e8830694056f71d62.zip tcl-f32a30e09c8e10a9cad9028e8830694056f71d62.tar.gz tcl-f32a30e09c8e10a9cad9028e8830694056f71d62.tar.bz2 |
* generic/tclNamesp.c (EnsembleImplementationCmd):
* tests/namespace.test (47.7-8): reverted a wrong "optimisation"
that completely broke snit; added two tests.
-rw-r--r-- | ChangeLog | 6 | ||||
-rw-r--r-- | generic/tclNamesp.c | 4 | ||||
-rw-r--r-- | tests/namespace.test | 20 |
3 files changed, 27 insertions, 3 deletions
@@ -1,3 +1,9 @@ +2006-10-26 Miguel Sofer <msofer@users.sf.net> + + * 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 <dkf@users.sf.net> * 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 { |