grep: be GNU compatible with -f EMPTY_FILE

Signed-off-by: Lauri Kasanen <curaga@operamail.com>
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
This commit is contained in:
Lauri Kasanen
2011-08-28 12:39:04 +02:00
committed by Denys Vlasenko
parent 2390109dcb
commit 7b46220d92
2 changed files with 30 additions and 10 deletions

View File

@@ -7,7 +7,7 @@
. ./testing.sh
# testing "test name" "options" "expected result" "file input" "stdin"
# testing "test name" "commands" "expected result" "file input" "stdin"
# file input will be file called "input"
# test can create a file "actual" instead of writing to stdout
@@ -103,4 +103,20 @@ testing "grep -o does not loop forever on zero-length match" \
"" \
"" "test\n"
testing "grep -f EMPTY_FILE" \
"grep -f input" \
"" \
"" \
"test\n"
testing "grep -v -f EMPTY_FILE" \
"grep -v -f input" \
"test\n" \
"" \
"test\n"
# testing "test name" "commands" "expected result" "file input" "stdin"
# file input will be file called "input"
# test can create a file "actual" instead of writing to stdout
exit $FAILCOUNT