diff options
author | jilles <jilles@FreeBSD.org> | 2013-01-13 19:39:13 +0000 |
---|---|---|
committer | jilles <jilles@FreeBSD.org> | 2013-01-13 19:39:13 +0000 |
commit | 84e42b7805c39027d2cbba2feea857fc032abcc5 (patch) | |
tree | c8e823fa035bccc0430bdd232c9bdf71828c3e9c /tools | |
parent | b479a582c314b537fc0c8e471a104bb84d9f9698 (diff) | |
download | FreeBSD-src-84e42b7805c39027d2cbba2feea857fc032abcc5.zip FreeBSD-src-84e42b7805c39027d2cbba2feea857fc032abcc5.tar.gz |
sh: Add some testcases related to subshells.
These failed in earlier attempts to execute more subshells without forking.
The patches are uncommitted.
Diffstat (limited to 'tools')
-rw-r--r-- | tools/regression/bin/sh/execution/subshell1.0 | 6 | ||||
-rw-r--r-- | tools/regression/bin/sh/execution/subshell1.0.stdout | 2 | ||||
-rw-r--r-- | tools/regression/bin/sh/execution/subshell2.0 | 10 | ||||
-rw-r--r-- | tools/regression/bin/sh/execution/subshell3.0 | 4 | ||||
-rw-r--r-- | tools/regression/bin/sh/execution/subshell4.0 | 3 |
5 files changed, 25 insertions, 0 deletions
diff --git a/tools/regression/bin/sh/execution/subshell1.0 b/tools/regression/bin/sh/execution/subshell1.0 new file mode 100644 index 0000000..347806e --- /dev/null +++ b/tools/regression/bin/sh/execution/subshell1.0 @@ -0,0 +1,6 @@ +# $FreeBSD$ + +(eval "cd / +v=$(printf %0100000d 1) +echo \${#v}") +echo end diff --git a/tools/regression/bin/sh/execution/subshell1.0.stdout b/tools/regression/bin/sh/execution/subshell1.0.stdout new file mode 100644 index 0000000..8c71af3 --- /dev/null +++ b/tools/regression/bin/sh/execution/subshell1.0.stdout @@ -0,0 +1,2 @@ +100000 +end diff --git a/tools/regression/bin/sh/execution/subshell2.0 b/tools/regression/bin/sh/execution/subshell2.0 new file mode 100644 index 0000000..3216449 --- /dev/null +++ b/tools/regression/bin/sh/execution/subshell2.0 @@ -0,0 +1,10 @@ +# $FreeBSD$ + +f() { + x=2 +} +( + x=1 + f + [ "$x" = 2 ] +) diff --git a/tools/regression/bin/sh/execution/subshell3.0 b/tools/regression/bin/sh/execution/subshell3.0 new file mode 100644 index 0000000..9a87acb --- /dev/null +++ b/tools/regression/bin/sh/execution/subshell3.0 @@ -0,0 +1,4 @@ +# $FreeBSD$ + +(false; exit) && exit 3 +exit 0 diff --git a/tools/regression/bin/sh/execution/subshell4.0 b/tools/regression/bin/sh/execution/subshell4.0 new file mode 100644 index 0000000..b39edb1 --- /dev/null +++ b/tools/regression/bin/sh/execution/subshell4.0 @@ -0,0 +1,3 @@ +# $FreeBSD$ + +(eval "set v=1"; false) && echo bad; : |