shell: some additions to *sh-misc/* tests
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
This commit is contained in:
parent
b920a38dc0
commit
ca50caacad
2
shell/ash_test/ash-misc/assignment2.right
Normal file
2
shell/ash_test/ash-misc/assignment2.right
Normal file
@ -0,0 +1,2 @@
|
||||
./assignment2.tests: line 2: a=b: not found
|
||||
127
|
3
shell/ash_test/ash-misc/assignment2.tests
Executable file
3
shell/ash_test/ash-misc/assignment2.tests
Executable file
@ -0,0 +1,3 @@
|
||||
# This must not be interpreted as an assignment
|
||||
a''=b true
|
||||
echo $?
|
6
shell/ash_test/ash-misc/empty_args.right
Normal file
6
shell/ash_test/ash-misc/empty_args.right
Normal file
@ -0,0 +1,6 @@
|
||||
Null 0th arg:
|
||||
./empty_args.tests: line 2: : Permission denied
|
||||
127
|
||||
Null 1st arg:
|
||||
0
|
||||
Null arg in exec:
|
9
shell/ash_test/ash-misc/empty_args.tests
Executable file
9
shell/ash_test/ash-misc/empty_args.tests
Executable file
@ -0,0 +1,9 @@
|
||||
echo Null 0th arg:
|
||||
""
|
||||
echo $?
|
||||
echo Null 1st arg:
|
||||
# printf without args would print usage info
|
||||
printf ""
|
||||
echo $?
|
||||
echo Null arg in exec:
|
||||
exec printf ""
|
2
shell/ash_test/ash-misc/env_and_func.right
Normal file
2
shell/ash_test/ash-misc/env_and_func.right
Normal file
@ -0,0 +1,2 @@
|
||||
var=val
|
||||
var=val
|
8
shell/ash_test/ash-misc/env_and_func.tests
Executable file
8
shell/ash_test/ash-misc/env_and_func.tests
Executable file
@ -0,0 +1,8 @@
|
||||
var=old
|
||||
f() { echo "var=$var"; }
|
||||
# bash: POSIXLY_CORRECT behavior is to "leak" new variable values
|
||||
# out of function invocations (similar to "special builtins" behavior);
|
||||
# but in "bash mode", they don't leak.
|
||||
# hush does not "leak" values. ash does.
|
||||
var=val f
|
||||
echo "var=$var"
|
@ -1,4 +1,8 @@
|
||||
var=old
|
||||
f() { echo "var=$var"; }
|
||||
# bash: POSIXLY_CORRECT behavior is to "leak" new variable values
|
||||
# out of function invocations (similar to "special builtins" behavior);
|
||||
# but in "bash mode", they don't leak.
|
||||
# hush does not "leak" values. ash does.
|
||||
var=val f
|
||||
echo "var=$var"
|
||||
|
Loading…
Reference in New Issue
Block a user