sh: Split off some special behaviour into separate tests.
This allows some other shells to pass the tests for basic behaviour.
This commit is contained in:
parent
ba13377a7e
commit
a9942298fe
@ -8,5 +8,4 @@
|
||||
trap - 99999 && exit 3
|
||||
trap true 99999 && exit 3
|
||||
} 2>/dev/null
|
||||
test -n "$(trap true garbage TERM 2>/dev/null || trap)" || exit 3
|
||||
exit 0
|
||||
|
7
tools/regression/bin/sh/builtins/trap8.0
Normal file
7
tools/regression/bin/sh/builtins/trap8.0
Normal file
@ -0,0 +1,7 @@
|
||||
# $FreeBSD$
|
||||
|
||||
# I am not sure if POSIX requires the shell to continue processing
|
||||
# further trap names in the same trap command after an invalid one.
|
||||
|
||||
test -n "$(trap true garbage TERM 2>/dev/null || trap)" || exit 3
|
||||
exit 0
|
@ -13,7 +13,7 @@ for s1 in "$nl" " "; do
|
||||
done
|
||||
done
|
||||
set -- $list
|
||||
for s2 in "$nl" " " ";" ";$nl"; do # s2=";" and ";$nl" are extensions to POSIX
|
||||
for s2 in "$nl" " "; do
|
||||
for s3 in "$nl" " "; do
|
||||
r=''
|
||||
eval "for i${s2}do${s3}r=\"\$r \$i\"; done"
|
||||
|
15
tools/regression/bin/sh/parser/for2.0
Normal file
15
tools/regression/bin/sh/parser/for2.0
Normal file
@ -0,0 +1,15 @@
|
||||
# $FreeBSD$
|
||||
|
||||
# Common extensions to the 'for' syntax.
|
||||
|
||||
nl='
|
||||
'
|
||||
list=' a b c'
|
||||
set -- $list
|
||||
for s2 in ";" ";$nl"; do
|
||||
for s3 in "$nl" " "; do
|
||||
r=''
|
||||
eval "for i${s2}do${s3}r=\"\$r \$i\"; done"
|
||||
[ "$r" = "$list" ] || exit 1
|
||||
done
|
||||
done
|
Loading…
x
Reference in New Issue
Block a user