From c0cb5278a3cf076a8f8b3f7ea74073989c4d2fa5 Mon Sep 17 00:00:00 2001 From: dkf Date: Wed, 19 May 2004 12:11:52 +0000 Subject: Standardize various minor aspects of test style --- tests/env.test | 35 ++++++++++++----------------------- 1 file changed, 12 insertions(+), 23 deletions(-) diff --git a/tests/env.test b/tests/env.test index 9cc5d1b..909c8e2 100644 --- a/tests/env.test +++ b/tests/env.test @@ -11,10 +11,16 @@ # See the file "license.terms" for information on usage and redistribution # of this file, and for a DISCLAIMER OF ALL WARRANTIES. # -# RCS: @(#) $Id: env.test,v 1.17 2002/10/03 13:34:32 dkf Exp $ +# RCS: @(#) $Id: env.test,v 1.18 2004/05/19 12:11:52 dkf Exp $ -package require tcltest 2 -namespace import -force ::tcltest::* +if {[lsearch [namespace children] ::tcltest] == -1} { + package require tcltest 2 + namespace import -force ::tcltest::* +} + +# Some tests require the "exec" command. +# Skip them if exec is not defined. +testConstraint exec [llength [info commands exec]] # # These tests will run on any platform (and indeed crashed @@ -53,11 +59,6 @@ test env-1.3 {reflection of env by "array names"} { expr {$ix >= 0} } {1} - -# Some tests require the "exec" command. -# Skip them if exec is not defined. -testConstraint exec [llength [info commands exec]] - set printenvScript [makeFile { proc lrem {listname name} { upvar $listname list @@ -106,9 +107,9 @@ foreach name [array names env] { # library if the initial tcltest is run from a non-standard place. # ('saved' env vars) foreach name {TCL_LIBRARY PATH LD_LIBRARY_PATH LIBPATH DISPLAY SHLIB_PATH} { - if {[info exists env2($name)]} { - set env($name) $env2($name); - } + if {[info exists env2($name)]} { + set env($name) $env2($name); + } } test env-2.1 {adding environment variables} {exec} { @@ -245,15 +246,3 @@ foreach name [array names env2] { removeFile $printenvScript ::tcltest::cleanupTests return - - - - - - - - - - - - -- cgit v0.12