summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--t/test-lib-functions.sh24
1 files changed, 20 insertions, 4 deletions
diff --git a/t/test-lib-functions.sh b/t/test-lib-functions.sh
index 64f793e3d7..1de31fae7f 100644
--- a/t/test-lib-functions.sh
+++ b/t/test-lib-functions.sh
@@ -733,14 +733,30 @@ test_i18ngrep () {
if test -n "$GETTEXT_POISON"
then
- : # pretend success
- elif test "x!" = "x$1"
+ # pretend success
+ return 0
+ fi
+
+ if test "x!" = "x$1"
then
shift
- ! grep "$@"
+ ! grep "$@" && return 0
+
+ echo >&2 "error: '! grep $@' did find a match in:"
else
- grep "$@"
+ grep "$@" && return 0
+
+ echo >&2 "error: 'grep $@' didn't find a match in:"
fi
+
+ if test -s "$last_arg"
+ then
+ cat >&2 "$last_arg"
+ else
+ echo >&2 "<File '$last_arg' is empty>"
+ fi
+
+ return 1
}
# Call any command "$@" but be more verbose about its