aboutsummaryrefslogtreecommitdiff
path: root/shell/ash_test
diff options
context:
space:
mode:
Diffstat (limited to 'shell/ash_test')
-rw-r--r--shell/ash_test/ash-misc/exitcode2.right4
-rwxr-xr-xshell/ash_test/ash-misc/exitcode2.tests12
2 files changed, 16 insertions, 0 deletions
diff --git a/shell/ash_test/ash-misc/exitcode2.right b/shell/ash_test/ash-misc/exitcode2.right
new file mode 100644
index 000000000..f7cb983c6
--- /dev/null
+++ b/shell/ash_test/ash-misc/exitcode2.right
@@ -0,0 +1,4 @@
+./test.sh: line 1: syntax error: unexpected ")"
+Done:2
+./exitcode2.tests: line 11: can't open does_not_exist: no such file
+Done:1
diff --git a/shell/ash_test/ash-misc/exitcode2.tests b/shell/ash_test/ash-misc/exitcode2.tests
new file mode 100755
index 000000000..79a6ebd50
--- /dev/null
+++ b/shell/ash_test/ash-misc/exitcode2.tests
@@ -0,0 +1,12 @@
+# syntax error should return status 2
+cat >test.sh <<EOF
+)
+EOF
+chmod +x test.sh
+$THIS_SH ./test.sh
+echo Done:$?
+rm -f test.sh
+
+# redirection error with special builtin should return status 1
+(eval cat <does_not_exist)
+echo Done:$?