summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authordgp <dgp@users.sourceforge.net>2013-01-30 18:58:37 (GMT)
committerdgp <dgp@users.sourceforge.net>2013-01-30 18:58:37 (GMT)
commit3ac002a666fce71f19f025288d9e18c0819bb91a (patch)
tree0bf3ad72dc599167e49c1f6917fd1fb260a7749e /tests
parent3475ea5378a063cc71bc3c0e35ae338c31d0426f (diff)
downloadtcl-3ac002a666fce71f19f025288d9e18c0819bb91a.zip
tcl-3ac002a666fce71f19f025288d9e18c0819bb91a.tar.gz
tcl-3ac002a666fce71f19f025288d9e18c0819bb91a.tar.bz2
For [package] etc., select modernizations from Patrick Fradin.
Diffstat (limited to 'tests')
-rw-r--r--tests/pkgMkIndex.test16
-rw-r--r--tests/tm.test2
2 files changed, 8 insertions, 10 deletions
diff --git a/tests/pkgMkIndex.test b/tests/pkgMkIndex.test
index 663a6b2..990bb5f 100644
--- a/tests/pkgMkIndex.test
+++ b/tests/pkgMkIndex.test
@@ -8,10 +8,8 @@
# Copyright (c) 1998-1999 by Scriptics Corporation.
# All rights reserved.
-if {[lsearch [namespace children] ::tcltest] == -1} {
- package require tcltest 2
- namespace import -force ::tcltest::*
-}
+package require tcltest 2
+namespace import ::tcltest::*
set fullPkgPath [makeDirectory pkg]
@@ -46,7 +44,7 @@ proc pkgtest::parseArgs { args } {
set a [lindex $args $iarg]
if {[regexp {^-} $a]} {
lappend options $a
- if {[string compare -load $a] == 0} {
+ if {$a eq "-load"} {
incr iarg
lappend options [lindex $args $iarg]
}
@@ -82,7 +80,7 @@ proc pkgtest::parseIndex { filePath } {
$slave eval {
rename package package_original
proc package { args } {
- if {[string compare [lindex $args 0] ifneeded] == 0} {
+ if {[lindex $args 0] eq "ifneeded"} {
set pkg [lindex $args 1]
set ver [lindex $args 2]
set ::PKGS($pkg:$ver) [lindex $args 3]
@@ -112,9 +110,9 @@ proc pkgtest::parseIndex { filePath } {
foreach k [lsort [array names P]] {
lappend PKGS $k $P($k)
}
- } err]} {
- set ei $::errorInfo
- set ec $::errorCode
+ } err opts]} {
+ set ei [dict get $opts -errorinfo]
+ set ec [dict get $opts -errorcode]
catch {interp delete $slave}
diff --git a/tests/tm.test b/tests/tm.test
index f6c9a68..3f93483 100644
--- a/tests/tm.test
+++ b/tests/tm.test
@@ -200,7 +200,7 @@ test tm-3.11 {tm: module path management, remove ignores unknown path} -setup {
proc genpaths {base} {
# Normalizing picks up drive letters on windows [Bug 1053568]
set base [file normalize $base]
- foreach {major minor} [split [info tclversion] .] break
+ lassign [split [package present Tcl] .] major minor
set results {}
set base [file join $base tcl$major]
lappend results [file join $base site-tcl]