From 5645bb01ffdfc76dbf7e9a026cb146f3d7b5eafc Mon Sep 17 00:00:00 2001 From: dgp Date: Thu, 13 Jun 2019 17:20:45 +0000 Subject: Test namespace-56.4 detects Bug 8b9854c3d8. Branch open to fix it. --- tests/namespace.test | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/tests/namespace.test b/tests/namespace.test index 1d26512..58d6839 100644 --- a/tests/namespace.test +++ b/tests/namespace.test @@ -3323,6 +3323,19 @@ namespace eval : { : p1 } 16fe1b5807 + +test namespace-56.4 {Bug 8b9854c3d8} -setup { + namespace eval namespace-56.4 { + proc cmd {} {string match ::* [lindex [info level 0] 0]} + namespace export * + namespace ensemble create + } +} -body { + namespace-56.4 cmd +} -cleanup { + namespace delete namespace-56.4 +} -result 1 + # cleanup catch {rename cmd1 {}} -- cgit v0.12 From 1cd98b93bd922cc624acf57f7547984606f4f565 Mon Sep 17 00:00:00 2001 From: dgp Date: Thu, 13 Jun 2019 17:37:46 +0000 Subject: Unique test name. --- tests/namespace.test | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/tests/namespace.test b/tests/namespace.test index 58d6839..eef2eb7 100644 --- a/tests/namespace.test +++ b/tests/namespace.test @@ -3324,16 +3324,16 @@ namespace eval : { : p1 } 16fe1b5807 -test namespace-56.4 {Bug 8b9854c3d8} -setup { - namespace eval namespace-56.4 { - proc cmd {} {string match ::* [lindex [info level 0] 0]} +test namespace-56.5 {Bug 8b9854c3d8} -setup { + namespace eval namespace-56.5 { + proc cmd {} {string match ::* [lindex [[string cat info] level 0] 0]} namespace export * namespace ensemble create } } -body { - namespace-56.4 cmd + namespace-56.5 cmd } -cleanup { - namespace delete namespace-56.4 + namespace delete namespace-56.5 } -result 1 -- cgit v0.12 From 1ebe878444abb6e6e9a919c99e6f1736353917ef Mon Sep 17 00:00:00 2001 From: dgp Date: Thu, 13 Jun 2019 17:58:48 +0000 Subject: Fix Bug 8b9854c3d8. Now 4 test failures require examination. --- generic/tclEnsemble.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/generic/tclEnsemble.c b/generic/tclEnsemble.c index dfffe12..3352d1f 100644 --- a/generic/tclEnsemble.c +++ b/generic/tclEnsemble.c @@ -2694,7 +2694,11 @@ BuildEnsembleConfig( if (isNew) { Tcl_Obj *cmdObj, *cmdPrefixObj; - cmdObj = Tcl_NewStringObj(nsCmdName, -1); + TclNewObj(cmdObj); + Tcl_AppendStringsToObj(cmdObj, + ensemblePtr->nsPtr->fullName, + (ensemblePtr->nsPtr->parentPtr ? "::" : ""), + nsCmdName, NULL); cmdPrefixObj = Tcl_NewListObj(1, &cmdObj); Tcl_SetHashValue(hPtr, cmdPrefixObj); Tcl_IncrRefCount(cmdPrefixObj); -- cgit v0.12 From 526c432322c2df709ecad50d5450141e8c883fa8 Mon Sep 17 00:00:00 2001 From: dgp Date: Thu, 13 Jun 2019 20:43:04 +0000 Subject: Mark test namespace-54.6 as knownBug. The real bug here is Tcl's failure to forbid ":" as a namespace name. --- tests/namespace.test | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/tests/namespace.test b/tests/namespace.test index eef2eb7..ad82abe 100644 --- a/tests/namespace.test +++ b/tests/namespace.test @@ -1797,7 +1797,7 @@ test namespace-42.7 {ensembles: nested} -body { list [ns x0 z] [ns x1] [ns x2] [ns x3] } -cleanup { namespace delete ns -} -result {{1 z} 1 2 3} +} -result {{1 ::ns::x0::z} 1 2 3} test namespace-42.8 { ensembles: [Bug 1670091], panic due to pointer to a deallocated List struct. @@ -2128,7 +2128,7 @@ test namespace-47.1 {ensemble: unknown handler} { lappend result [catch {ns c d e} msg] $msg lappend result [catch {ns Magic foo bar spong wibble} msg] $msg list $result [lsort [info commands ::ns::*]] $log [namespace delete ns] -} {{0 2 0 2 0 2 0 2 1 {unknown or protected subcommand "Magic"}} {::ns::Magic ::ns::a ::ns::b ::ns::c} {{making a} {running a b c} {running a b c} {making b} {running b c d} {making c} {running c d e} {unknown Magic - args = foo bar spong wibble}} {}} +} {{0 2 0 2 0 2 0 2 1 {unknown or protected subcommand "Magic"}} {::ns::Magic ::ns::a ::ns::b ::ns::c} {{making a} {running ::ns::a b c} {running ::ns::a b c} {making b} {running ::ns::b c d} {making c} {running ::ns::c d e} {unknown Magic - args = foo bar spong wibble}} {}} test namespace-47.2 {ensemble: unknown handler} { namespace eval ns { namespace export {[a-z]*} @@ -3227,7 +3227,7 @@ test namespace-53.10 {ensembles: nested rewrite} -setup { 1 {wrong # args: should be "ns z1 x a1"}\ 1 {wrong # args: should be "ns z2 x a1 a2"}\ 1 {wrong # args: should be "ns z2 x a1 a2"}\ - 1 {wrong # args: should be "z0"}\ + 1 {wrong # args: should be "::ns::x::z0"}\ 0 {1 v}\ 1 {wrong # args: should be "ns v x z2 a2"}\ 0 {2 v v2}} @@ -3312,7 +3312,7 @@ test namespace-56.3 {bug f97d4ee020: mutually-entangled deletion} { } } {::testing::abc::def ::testing::abc::ghi} -test namespace-56.4 {bug 16fe1b5807: names starting with ":"} { +test namespace-56.4 {bug 16fe1b5807: names starting with ":"} knownBug { namespace eval : { namespace ensemble create namespace export * -- cgit v0.12