From c6f3f1f2051c0e0663480e2fb858e9436d3adcc4 Mon Sep 17 00:00:00 2001 From: ericm Date: Fri, 28 Jan 2000 19:32:05 +0000 Subject: * tests/pkg/spacename.tcl: * tests/pkgMkIndex.test: Tests for fix for bug #2360. * library/package.tcl: Fixed to extract only the first element of the list returned by auto_qualify (bug #2360). --- library/package.tcl | 5 +++-- tests/pkg/spacename.tcl | 3 +++ tests/pkgMkIndex.test | 8 +++++++- 3 files changed, 13 insertions(+), 3 deletions(-) create mode 100644 tests/pkg/spacename.tcl diff --git a/library/package.tcl b/library/package.tcl index f0f9f44..c9506a8 100644 --- a/library/package.tcl +++ b/library/package.tcl @@ -3,7 +3,7 @@ # utility procs formerly in init.tcl which can be loaded on demand # for package management. # -# RCS: @(#) $Id: package.tcl,v 1.8 2000/01/27 19:48:29 ericm Exp $ +# RCS: @(#) $Id: package.tcl,v 1.9 2000/01/28 19:32:05 ericm Exp $ # # Copyright (c) 1991-1993 The Regents of the University of California. # Copyright (c) 1994-1998 Sun Microsystems, Inc. @@ -302,7 +302,8 @@ proc pkg_mkIndex {args} { # special case so that global names have no leading # ::, this is required by the unknown command - set ::tcl::abs [auto_qualify $::tcl::abs ::] + set ::tcl::abs \ + [lindex [auto_qualify $::tcl::abs ::] 0] if {[string compare $::tcl::x $::tcl::abs]} { # Name changed during qualification diff --git a/tests/pkg/spacename.tcl b/tests/pkg/spacename.tcl new file mode 100644 index 0000000..7b48e76 --- /dev/null +++ b/tests/pkg/spacename.tcl @@ -0,0 +1,3 @@ +package provide spacename 1.0 +proc {a b} {} {} +proc {c d} {} {} diff --git a/tests/pkgMkIndex.test b/tests/pkgMkIndex.test index 664505c..cc37f4f 100644 --- a/tests/pkgMkIndex.test +++ b/tests/pkgMkIndex.test @@ -8,7 +8,7 @@ # Copyright (c) 1998-1999 by Scriptics Corporation. # All rights reserved. # -# RCS: @(#) $Id: pkgMkIndex.test,v 1.14 2000/01/27 19:48:30 ericm Exp $ +# RCS: @(#) $Id: pkgMkIndex.test,v 1.15 2000/01/28 19:32:05 ericm Exp $ if {[lsearch [namespace children] ::tcltest] == -1} { package require tcltest @@ -356,6 +356,12 @@ test pkgMkIndex-12.1 {same name procs in different namespace} { pkgtest::runIndex -lazy $fullPkgPath samename.tcl } {0 {{football:1.0 {tclPkgSetup {samename.tcl source {::college::team ::pro::team}}}}}} +# Proc names with embedded spaces are properly listed (ie, correct number of +# braces) in result +test pkgMkIndex-13.1 {proc names with embedded spaces} { + pkgtest::runIndex -lazy $fullPkgPath spacename.tcl +} {0 {{spacename:1.0 {tclPkgSetup {spacename.tcl source {{a b} {c d}}}}}}} + # cleanup namespace delete pkgtest -- cgit v0.12