From c08b0e27b2710edde91420a346e83acb50560415 Mon Sep 17 00:00:00 2001 From: Joachim Breitner Date: Wed, 29 Jul 2009 13:23:16 +0200 Subject: [PATCH] [tests] assert_grep_not function --- tests/tests.sh | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/tests/tests.sh b/tests/tests.sh index b22cd02..d6da884 100755 --- a/tests/tests.sh +++ b/tests/tests.sh @@ -36,6 +36,18 @@ function assert_grep { fi } +function assert_grep_not { + cat > $testdir/assert_grep + if grep -q "$1" $testdir/assert_grep + then + echo "Could find unexpected \"$1\" in:" + cat $testdir/assert_grep + # We are in a pipe, i.e. a subshell, so kill the parent + kill -TERM $parent_pid + exit 1 + fi +} + cd "$(dirname $0)"/.. assert "[ -e bin/wanna-build ]" -- 2.39.2