1 # These tests are design especially for the vfork() implementation
2 # of exec where sh -c must be used and thus we must take extra care
3 # in quoting arguments to exec.
5 source [file dirname [info script]]/testing.tcl
13 array set saveenv [array get env]
15 test exec2-1.1 "Quoting - Result" {
16 exec echo ${d}double quoted${d} ${s}single quoted${s} ${b}backslash quoted${b}
17 } "\"double\ quoted\"\ 'single quoted'\ \\backslash\ quoted\\"
19 test exec2-1.2 "Quoting - Word Grouping" {
20 string trim [exec echo ${d}double quoted${d} ${s}single quoted${s} ${b}backslash quoted${b} | wc -w]
23 test exec2-2.1 "Add to exec environment" {
24 set env(TESTENV) "the value"
25 exec printenv | sed -n -e /^TESTENV=/p
28 test exec2-2.2 "Remove from exec environment" {
29 set env(TESTENV2) "new value"
31 exec printenv | sed -n -e /^TESTENV=/p
35 test exec2-2.3 "Remove all exec environment" {
37 exec printenv | sed -n -e /^TESTENV2=/p
40 test exec2-2.4 "Remove all env var" {
42 exec printenv | sed -n -e /^TESTENV2=/p
45 array set env [array get saveenv]