summaryrefslogtreecommitdiffstats
path: root/tests/env.test
diff options
context:
space:
mode:
Diffstat (limited to 'tests/env.test')
-rw-r--r--tests/env.test14
1 files changed, 7 insertions, 7 deletions
diff --git a/tests/env.test b/tests/env.test
index e75d517..8f22f53 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.
-if {[lsearch [namespace children] ::tcltest] == -1} {
+if {"::tcltest" ni [namespace children]} {
package require tcltest 2
namespace import -force ::tcltest::*
}
@@ -26,7 +26,7 @@ testConstraint exec [llength [info commands exec]]
#
test env-1.1 {propagation of env values to child interpreters} -setup {
catch {interp delete child}
- catch {unset env(test)}
+ unset -nocomplain env(test)
} -body {
interp create child
set env(test) garbage
@@ -40,7 +40,7 @@ test env-1.1 {propagation of env values to child interpreters} -setup {
# runs.
#
test env-1.2 {lappend to env value} -setup {
- catch {unset env(test)}
+ unset -nocomplain env(test)
} -body {
set env(test) aaaaaaaaaaaaaaaa
append env(test) bbbbbbbbbbbbbb
@@ -48,14 +48,14 @@ test env-1.2 {lappend to env value} -setup {
}
test env-1.3 {reflection of env by "array names"} -setup {
catch {interp delete child}
- catch {unset env(test)}
+ unset -nocomplain env(test)
} -body {
interp create child
child eval {set env(test) garbage}
expr {"test" in [array names env]}
} -cleanup {
interp delete child
- catch {unset env(test)}
+ unset -nocomplain env(test)
} -result {1}
set printenvScript [makeFile {
@@ -103,9 +103,9 @@ set printenvScript [makeFile {
# processes.
proc getenv {} {
global printenvScript tcltest
- catch {exec [interpreter] $printenvScript} out
+ catch {exec -- [interpreter] $printenvScript} out
if {$out eq "child process exited abnormally"} {
- set out {}
+ set out ""
}
return $out
}