diff options
author | Ian Jackson <ijackson@chiark.greenend.org.uk> | 2015-07-11 13:40:00 +0100 |
---|---|---|
committer | Ian Jackson <ijackson@chiark.greenend.org.uk> | 2015-07-11 13:48:43 +0100 |
commit | 5339e3c5dcc53b10ea981c106ad7211b5a701ee1 (patch) | |
tree | 9213863bbaef7b3238ab5bba36b4d361340d8ab8 /tests/lib | |
parent | c17699d17f17f6ea105b7440ff95fa39eebb54a6 (diff) |
Test suite: Move setting of grepper in t-expect-fail (nfc)
Diffstat (limited to 'tests/lib')
-rw-r--r-- | tests/lib | 22 |
1 files changed, 11 insertions, 11 deletions
@@ -47,6 +47,17 @@ END t-expect-fail () { local mpat="$1"; shift + set +o pipefail + LC_MESSAGES=C "$@" 2>&1 | tee $tmp/t.output + local ps="${PIPESTATUS[*]}" + set -o pipefail + + case $ps in + "0 0") fail "command unexpectedly succeeded (instead of: $mpat)" ;; + *" 0") ;; + *) fail "tee failed" ;; + esac + local grepper=fgrep case "$mpat" in [A-Z]:*) @@ -59,17 +70,6 @@ t-expect-fail () { ;; esac - set +o pipefail - LC_MESSAGES=C "$@" 2>&1 | tee $tmp/t.output - local ps="${PIPESTATUS[*]}" - set -o pipefail - - case $ps in - "0 0") fail "command unexpectedly succeeded (instead of: $mpat)" ;; - *" 0") ;; - *) fail "tee failed" ;; - esac - $grepper -e "$mpat" $tmp/t.output || fail "error message not found" } |