aboutsummaryrefslogtreecommitdiffstats
path: root/contrib/tcl/tests/env.test
diff options
context:
space:
mode:
Diffstat (limited to 'contrib/tcl/tests/env.test')
-rw-r--r--contrib/tcl/tests/env.test41
1 files changed, 33 insertions, 8 deletions
diff --git a/contrib/tcl/tests/env.test b/contrib/tcl/tests/env.test
index e76ad7d58720..1bfc8ddaf1f3 100644
--- a/contrib/tcl/tests/env.test
+++ b/contrib/tcl/tests/env.test
@@ -10,10 +10,35 @@
# 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.13 97/08/05 11:40:30
+# SCCS: @(#) env.test 1.14 97/10/31 17:00:03
if {[string compare test [info procs test]] == 1} then {source defs}
+#
+# These tests will run on any platform (and indeed crashed
+# on the Mac). So put them before you test for the existance
+# of exec.
+#
+test env-1.1 {propagation of env values to child interpreters} {
+ catch {interp delete child}
+ catch {unset env(test)}
+ interp create child
+ set env(test) garbage
+ set return [child eval {set env(test)}]
+ interp delete child
+ unset env(test)
+ set return
+} {garbage}
+#
+# This one crashed on Solaris under Tcl8.0, so we only
+# want to make sure it runs.
+#
+test env-1.2 {lappend to env value} {
+ catch {unset env(test)}
+ set env(test) aaaaaaaaaaaaaaaa
+ append env(test) bbbbbbbbbbbbbb
+ unset env(test)
+} {}
if {[info commands exec] == ""} {
puts "exec not implemented for this machine"
return
@@ -76,42 +101,42 @@ foreach name {TCL_LIBRARY PATH LD_LIBRARY_PATH} {
}
}
-test env-1.1 {adding environment variables} {
+test env-2.1 {adding environment variables} {
getenv
} {}
set env(NAME1) "test string"
-test env-1.2 {adding environment variables} {
+test env-2.2 {adding environment variables} {
getenv
} {NAME1=test string}
set env(NAME2) "more"
-test env-1.3 {adding environment variables} {
+test env-2.3 {adding environment variables} {
getenv
} {NAME1=test string
NAME2=more}
set env(XYZZY) "garbage"
-test env-1.4 {adding environment variables} {
+test env-2.4 {adding environment variables} {
getenv
} {NAME1=test string
NAME2=more
XYZZY=garbage}
set env(NAME2) "new value"
-test env-2.1 {changing environment variables} {
+test env-3.1 {changing environment variables} {
getenv
} {NAME1=test string
NAME2=new value
XYZZY=garbage}
unset env(NAME2)
-test env-3.1 {unsetting environment variables} {
+test env-4.1 {unsetting environment variables} {
getenv
} {NAME1=test string
XYZZY=garbage}
unset env(NAME1)
-test env-3.2 {unsetting environment variables} {
+test env-4.2 {unsetting environment variables} {
getenv
} {XYZZY=garbage}