summaryrefslogtreecommitdiffstats
path: root/tests/env.test
diff options
context:
space:
mode:
authordgp <dgp@users.sourceforge.net>2006-03-21 15:32:13 (GMT)
committerdgp <dgp@users.sourceforge.net>2006-03-21 15:32:13 (GMT)
commit458fdd4426e9f3e1e99f2f6758aca0116bf2defc (patch)
tree4282db4735ee1471d85c38a03a2917b2e1327b60 /tests/env.test
parentff89f93ccc6d322f56000e43b4d6ca474a2bede8 (diff)
downloadtcl-458fdd4426e9f3e1e99f2f6758aca0116bf2defc.zip
tcl-458fdd4426e9f3e1e99f2f6758aca0116bf2defc.tar.gz
tcl-458fdd4426e9f3e1e99f2f6758aca0116bf2defc.tar.bz2
* tests/env.test: Preserve case of saved env vars. [Bug 1409272]
Diffstat (limited to 'tests/env.test')
-rw-r--r--tests/env.test24
1 files changed, 9 insertions, 15 deletions
diff --git a/tests/env.test b/tests/env.test
index 293cd60..f388f67 100644
--- a/tests/env.test
+++ b/tests/env.test
@@ -11,7 +11,7 @@
# 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.25 2006/03/21 14:33:24 dgp Exp $
+# RCS: @(#) $Id: env.test,v 1.26 2006/03/21 15:32:17 dgp Exp $
if {[lsearch [namespace children] ::tcltest] == -1} {
package require tcltest 2
@@ -103,24 +103,18 @@ proc getenv {} {
# Save the current environment variables at the start of the test.
foreach name [array names env] {
- set env2([string toupper $name]) $env($name)
- unset env($name)
-}
+ set env2($name) $env($name)
-# Added the following lines so that child tcltest can actually find its
-# 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
- DYLD_LIBRARY_PATH DYLD_FRAMEWORK_PATH SYSTEMDRIVE SYSTEMROOT
-} {
- if {[info exists env2($name)]} {
- set env($name) $env2($name);
+ # Keep some environment variables that support operation of the
+ # tcltest package.
+ if {[string toupper $name] ni {
+ TCL_LIBRARY PATH LD_LIBRARY_PATH LIBPATH DISPLAY SHLIB_PATH
+ DYLD_LIBRARY_PATH DYLD_FRAMEWORK_PATH SYSTEMDRIVE SYSTEMROOT
+ }} {
+ unset env($name)
}
}
-#array set env [array get env2 S*]
-
test env-2.1 {adding environment variables} {exec} {
getenv
} {}