sh: Add some testcases related to subshells.

These failed in earlier attempts to execute more subshells without forking.
The patches are uncommitted.
This commit is contained in:
Jilles Tjoelker 2013-01-13 19:39:13 +00:00
parent 31d396587e
commit f897e827b9
5 changed files with 25 additions and 0 deletions

View File

@ -0,0 +1,6 @@
# $FreeBSD$
(eval "cd /
v=$(printf %0100000d 1)
echo \${#v}")
echo end

View File

@ -0,0 +1,2 @@
100000
end

View File

@ -0,0 +1,10 @@
# $FreeBSD$
f() {
x=2
}
(
x=1
f
[ "$x" = 2 ]
)

View File

@ -0,0 +1,4 @@
# $FreeBSD$
(false; exit) && exit 3
exit 0

View File

@ -0,0 +1,3 @@
# $FreeBSD$
(eval "set v=1"; false) && echo bad; :