summaryrefslogtreecommitdiffstats
path: root/tests/env.test
diff options
context:
space:
mode:
Diffstat (limited to 'tests/env.test')
-rw-r--r--tests/env.test39
1 files changed, 35 insertions, 4 deletions
diff --git a/tests/env.test b/tests/env.test
index 1bfc8dd..cd2c354 100644
--- a/tests/env.test
+++ b/tests/env.test
@@ -10,7 +10,7 @@
# See the file "license.terms" for information on usage and redistribution
# of this file, and for a DISCLAIMER OF ALL WARRANTIES.
#
-# SCCS: @(#) env.test 1.14 97/10/31 17:00:03
+# SCCS: @(#) env.test 1.18 98/02/17 23:45:10
if {[string compare test [info procs test]] == 1} then {source defs}
@@ -38,7 +38,20 @@ test env-1.2 {lappend to env value} {
set env(test) aaaaaaaaaaaaaaaa
append env(test) bbbbbbbbbbbbbb
unset env(test)
-} {}
+} {}
+test env-1.3 {reflection of env by "array names"} {
+ catch {interp delete child}
+ catch {unset env(test)}
+ interp create child
+ child eval {set env(test) garbage}
+ set names [array names env]
+ interp delete child
+ set ix [lsearch $names test]
+ catch {unset env(test)}
+ expr {$ix >= 0}
+} {1}
+#
+
if {[info commands exec] == ""} {
puts "exec not implemented for this machine"
return
@@ -67,7 +80,7 @@ puts $f {
lrem names ComSpec
lrem names ""
}
- foreach name {TCL_LIBRARY PATH LD_LIBRARY_PATH} {
+ foreach name {TCL_LIBRARY PATH LD_LIBRARY_PATH PURE_PROG_NAME DISPLAY} {
lrem names $name
}
foreach p $names {
@@ -95,7 +108,7 @@ foreach name [array names env] {
# 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} {
+foreach name {TCL_LIBRARY PATH LD_LIBRARY_PATH DISPLAY} {
if {[info exists env2($name)]} {
set env($name) $env2($name);
}
@@ -139,6 +152,22 @@ unset env(NAME1)
test env-4.2 {unsetting environment variables} {
getenv
} {XYZZY=garbage}
+unset env(XYZZY)
+
+test env-4.3 {setting international environment variables} {
+ set env(\ua7) \ub6
+ getenv
+} "\ua7=\ub6"
+test env-4.4 {changing international environment variables} {
+ set env(\ua7) \ua7
+ getenv
+} "\ua7=\ua7"
+test env-4.5 {unsetting international environment variables} {
+ set env(\ub6) \ua7
+ unset env(\ua7)
+ getenv
+} "\ub6=\ua7"
+unset env(\ub6)
# Restore the environment variables at the end of the test.
@@ -150,3 +179,5 @@ foreach name [array names env2] {
}
file delete printenv
+
+return