summaryrefslogtreecommitdiff
path: root/regress/bin/ksh
diff options
context:
space:
mode:
Diffstat (limited to 'regress/bin/ksh')
-rw-r--r--regress/bin/ksh/obsd-regress.t90
1 files changed, 89 insertions, 1 deletions
diff --git a/regress/bin/ksh/obsd-regress.t b/regress/bin/ksh/obsd-regress.t
index d94695111cf..b9b33d17655 100644
--- a/regress/bin/ksh/obsd-regress.t
+++ b/regress/bin/ksh/obsd-regress.t
@@ -1,4 +1,4 @@
-# $OpenBSD: obsd-regress.t,v 1.11 2020/05/22 08:45:23 anton Exp $
+# $OpenBSD: obsd-regress.t,v 1.12 2020/07/07 10:33:58 jca Exp $
#
# ksh regression tests from OpenBSD
@@ -514,3 +514,91 @@ description:
stdin:
kill -s SIGINFO $$
---
+
+name: pipeline-pipefail-1
+description:
+ check pipeline return status
+stdin:
+ set -o pipefail
+ true | true
+---
+
+name: pipeline-pipefail-2
+description:
+ check pipeline return status
+stdin:
+ set -o pipefail
+ false | true
+expected-exit: e == 1
+---
+
+name: pipeline-pipefail-3
+description:
+ check pipeline return status
+stdin:
+ set -o pipefail
+ true | false
+expected-exit: e == 1
+---
+
+name: pipeline-pipefail-4
+description:
+ check pipeline return status
+stdin:
+ set -o pipefail
+ ! false | true
+---
+
+name: pipeline-pipefail-errexit-1
+description:
+ check pipeline return status
+stdin:
+ set -e
+ false | true
+ echo "ok"
+expected-stdout: ok
+---
+
+name: pipeline-pipefail-errexit-2
+description:
+ check pipeline return status
+stdin:
+ set -e
+ set -o pipefail
+ false | true
+ echo "should not print"
+expected-exit: e == 1
+expected-stdout:
+---
+
+name: pipeline-pipefail-errexit-3
+description:
+ check pipeline return status
+stdin:
+ set -e
+ set -o pipefail
+ false | true || echo "ok"
+expected-stdout: ok
+---
+
+name: pipeline-pipefail-check-time-1
+description:
+ check pipeline return status
+stdin:
+ false | true &
+ p=$!
+ set -o pipefail
+ wait $p
+---
+
+name: pipeline-pipefail-check-time-2
+description:
+ check pipeline return status
+stdin:
+ set -o pipefail
+ false | true &
+ p=$!
+ set +o pipefail
+ wait $p
+expected-exit: e == 1
+---