diff options
author | stanton <stanton> | 1998-09-21 23:39:52 (GMT) |
---|---|---|
committer | stanton <stanton> | 1998-09-21 23:39:52 (GMT) |
commit | 494c2de3a748b449c69ce322a1a741f5a31fd4d5 (patch) | |
tree | c3ece48c0ae3f4ba54787e0e8e729b65752ef3f9 /tests/env.test | |
parent | 7a698c0488d99c0af42022714638ae1ba2afaa49 (diff) | |
download | tcl-494c2de3a748b449c69ce322a1a741f5a31fd4d5.zip tcl-494c2de3a748b449c69ce322a1a741f5a31fd4d5.tar.gz tcl-494c2de3a748b449c69ce322a1a741f5a31fd4d5.tar.bz2 |
Added contents of Tcl 8.1a2
Diffstat (limited to 'tests/env.test')
-rw-r--r-- | tests/env.test | 39 |
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 |