diff options
author | Denys Vlasenko | 2010-05-18 14:35:20 +0200 |
---|---|---|
committer | Denys Vlasenko | 2010-05-18 14:35:20 +0200 |
commit | 51b4a9e2f192c03039f339401026752f6340df25 (patch) | |
tree | 82eca7c223ca74293038c7b5d2a6843a12a81b60 /shell/ash_test/ash-vars | |
parent | 5e2d572381dd0c354a4463382fe1297c709a8464 (diff) | |
download | busybox-51b4a9e2f192c03039f339401026752f6340df25.zip busybox-51b4a9e2f192c03039f339401026752f6340df25.tar.gz |
ash: fix var_leak testcase
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
Diffstat (limited to 'shell/ash_test/ash-vars')
-rw-r--r-- | shell/ash_test/ash-vars/var_leak.right | 3 | ||||
-rwxr-xr-x | shell/ash_test/ash-vars/var_leak.tests | 19 |
2 files changed, 16 insertions, 6 deletions
diff --git a/shell/ash_test/ash-vars/var_leak.right b/shell/ash_test/ash-vars/var_leak.right index 45c5458..be78112 100644 --- a/shell/ash_test/ash-vars/var_leak.right +++ b/shell/ash_test/ash-vars/var_leak.right @@ -1,2 +1,3 @@ should be empty: '' -should be empty: '' +should be not empty: 'val2' +should be not empty: 'val3' diff --git a/shell/ash_test/ash-vars/var_leak.tests b/shell/ash_test/ash-vars/var_leak.tests index 1b1123f..0320592 100755 --- a/shell/ash_test/ash-vars/var_leak.tests +++ b/shell/ash_test/ash-vars/var_leak.tests @@ -1,9 +1,18 @@ -# This currently fails with CONFIG_FEATURE_SH_NOFORK=y +# true is a regular builtin, varibale should not leak out of it +# this currently fails with CONFIG_FEATURE_SH_NOFORK=y VAR='' -VAR=qwe true +VAR=val1 true echo "should be empty: '$VAR'" -# This fails (always) +# ash follows the "special builtin leaks variables" rule here: +# exec is a special builtin. (bash does not do it) VAR='' -VAR=qwe exec 2>&1 -echo "should be empty: '$VAR'" +VAR=val2 exec 2>&1 +echo "should be not empty: '$VAR'" + +# ash follows the "function call is a special builtin" rule here +# (bash does not do it) +f() { true; } +VAR='' +VAR=val3 f +echo "should be not empty: '$VAR'" |