grep -vqE succeeds when any line does not match, even if another line contains the forbidden pattern. It also fails on empty output. Accept only exit status 1 from a non-inverted grep: the pattern was not found. A matching line or a grep error must fail the assertion. Assisted-by: LLM Signed-off-by: Dave Seddon --- testsuite/lib/generic.sh | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/testsuite/lib/generic.sh b/testsuite/lib/generic.sh index 8b339ec1..ac48f023 100644 --- a/testsuite/lib/generic.sh +++ b/testsuite/lib/generic.sh @@ -113,8 +113,9 @@ test_on() test_on_not() { - echo -n "test on: \"$1\"" - if cat "$STD_OUT" | grep -vqE "$1" + echo -n "test on absence: \"$1\"" + grep -qE -- "$1" "$STD_OUT" + if [ "$?" -eq 1 ] then pr_success else -- 2.55.0