summaryrefslogtreecommitdiffstats
path: root/tests/env.test
diff options
context:
space:
mode:
authordkf <donal.k.fellows@manchester.ac.uk>2004-05-19 12:11:52 (GMT)
committerdkf <donal.k.fellows@manchester.ac.uk>2004-05-19 12:11:52 (GMT)
commitc0cb5278a3cf076a8f8b3f7ea74073989c4d2fa5 (patch)
tree33782531b8be8445e589b20b16d181995c19645d /tests/env.test
parent078400c2171d1c54045990246e5fe6d826539b99 (diff)
downloadtcl-c0cb5278a3cf076a8f8b3f7ea74073989c4d2fa5.zip
tcl-c0cb5278a3cf076a8f8b3f7ea74073989c4d2fa5.tar.gz
tcl-c0cb5278a3cf076a8f8b3f7ea74073989c4d2fa5.tar.bz2
Standardize various minor aspects of test style
Diffstat (limited to 'tests/env.test')
-rw-r--r--tests/env.test35
1 files 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
-
-
-
-
-
-
-
-
-
-
-
-