Artifact
9d6f6cbc2c99e521127ace21a90aa7d90aee8633:
Attachment "runtest.tcl" to
ticket [1101678fff]
added by
vincentdarley
2005-01-13 21:48:58.
cd $env(TEMP)
set pkg testpkg
# Set things up
file mkdir $pkg
cd $pkg
set ifneed "tclPkgSetup \$dir $pkg 1.0 {{testpkg.tcl source {::testpkg::one}}}"
set fout [open pkgIndex.tcl w]
puts $fout "package ifneeded $pkg 1.0 \[list $ifneed\]"
close $fout
set fout [open testpkg2.tcl w]
puts $fout {namespace eval testpkg {}}
puts $fout {proc ::testpkg::one {args} { return "one" }}
close $fout
set fout [open testpkg2.tcl w]
puts $fout {namespace eval testpkg {}}
puts $fout {proc ::testpkg::two {args} { return "two" }}
close $fout
cd ..
lappend auto_path [pwd]
# Now test
package require $pkg
set res {}
# Let's check whether we can and then load the first proc
lappend res [info exists auto_index(::testpkg::one)]
lappend res [info procs ::testpkg::one]
lappend res [auto_load testpkg::one]
lappend res [info procs ::testpkg::one]
auto_reset
# Let's check whether we can and then load the second proc
# This one fails. We can never get hold of testpkg::two
# without forgetting testpkg.
lappend res [info exists auto_index(::testpkg::two)]
lappend res [info procs ::testpkg::two]
lappend res [auto_load testpkg::two]
lappend res [info procs ::testpkg::two]
set res