summaryrefslogtreecommitdiffstats
path: root/tools
diff options
context:
space:
mode:
authorjilles <jilles@FreeBSD.org>2013-01-13 19:39:13 +0000
committerjilles <jilles@FreeBSD.org>2013-01-13 19:39:13 +0000
commit84e42b7805c39027d2cbba2feea857fc032abcc5 (patch)
treec8e823fa035bccc0430bdd232c9bdf71828c3e9c /tools
parentb479a582c314b537fc0c8e471a104bb84d9f9698 (diff)
downloadFreeBSD-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.06
-rw-r--r--tools/regression/bin/sh/execution/subshell1.0.stdout2
-rw-r--r--tools/regression/bin/sh/execution/subshell2.010
-rw-r--r--tools/regression/bin/sh/execution/subshell3.04
-rw-r--r--tools/regression/bin/sh/execution/subshell4.03
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; :
OpenPOWER on IntegriCloud