summaryrefslogtreecommitdiff
path: root/shell/hush_test/hush-invert
diff options
context:
space:
mode:
authorDenys Vlasenko2016-10-02 17:39:31 +0200
committerDenys Vlasenko2016-10-02 17:39:31 +0200
commit5d6b8729ed7335c702022f4f3176573f4cf2cf5a (patch)
treebef985dae4fb3ea41e1a478a848d19039b0e5d8f /shell/hush_test/hush-invert
parent888527cceec2f58f1eae3acceddee928b5cb647a (diff)
downloadbusybox-5d6b8729ed7335c702022f4f3176573f4cf2cf5a.zip
busybox-5d6b8729ed7335c702022f4f3176573f4cf2cf5a.tar.gz
hush testsuite: add many tests from ash testsuite
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
Diffstat (limited to 'shell/hush_test/hush-invert')
-rw-r--r--shell/hush_test/hush-invert/invert.right10
-rwxr-xr-xshell/hush_test/hush-invert/invert.tests19
2 files changed, 29 insertions, 0 deletions
diff --git a/shell/hush_test/hush-invert/invert.right b/shell/hush_test/hush-invert/invert.right
new file mode 100644
index 0000000..5a9239a
--- /dev/null
+++ b/shell/hush_test/hush-invert/invert.right
@@ -0,0 +1,10 @@
+1
+1
+1
+0
+0
+1
+0
+1
+0
+1
diff --git a/shell/hush_test/hush-invert/invert.tests b/shell/hush_test/hush-invert/invert.tests
new file mode 100755
index 0000000..8393d95
--- /dev/null
+++ b/shell/hush_test/hush-invert/invert.tests
@@ -0,0 +1,19 @@
+# tests of return value inversion
+# placeholder for future expansion
+
+# user subshells (...) did this wrong in bash versions before 2.04
+
+! ( echo hello | grep h >/dev/null 2>&1 ); echo $?
+! echo hello | grep h >/dev/null 2>&1 ; echo $?
+
+! true ; echo $?
+! false; echo $?
+
+! (false) ; echo $?
+! (true); echo $?
+
+! true | false ; echo $?
+! false | true ; echo $?
+
+! (true | false) ; echo $?
+! (false | true) ; echo $?