chiark
/
gitweb
/
~ianmdlvl
/
dgit.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
c17699d
)
Test suite: Move setting of grepper in t-expect-fail (nfc)
author
Ian Jackson
<ijackson@chiark.greenend.org.uk>
Sat, 11 Jul 2015 12:40:00 +0000
(13:40 +0100)
committer
Ian Jackson
<ijackson@chiark.greenend.org.uk>
Sat, 11 Jul 2015 12:48:43 +0000
(13:48 +0100)
tests/lib
patch
|
blob
|
history
diff --git
a/tests/lib
b/tests/lib
index 046d36289c1145b53d37f7b7d1dbd4d575e4d9b2..7cd8062cae3c7d1b6671832bce1197a9d35a587a 100644
(file)
--- a/
tests/lib
+++ b/
tests/lib
@@
-47,6
+47,17
@@
END
t-expect-fail () {
local mpat="$1"; shift
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]:*)
local grepper=fgrep
case "$mpat" in
[A-Z]:*)
@@
-59,17
+70,6
@@
t-expect-fail () {
;;
esac
;;
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"
}
$grepper -e "$mpat" $tmp/t.output ||
fail "error message not found"
}