From 133cc5b85f3363bf0c252a3f8bf6fd259177b066 Mon Sep 17 00:00:00 2001 From: Rob Landley Date: Sun, 11 Aug 2013 01:03:26 -0500 Subject: More grep tests. --- scripts/test/grep.test | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/scripts/test/grep.test b/scripts/test/grep.test index 13b8e0bb..3d6c40da 100755 --- a/scripts/test/grep.test +++ b/scripts/test/grep.test @@ -73,3 +73,17 @@ testing "grep -nom" "grep -nom 2 one" "1:one\n1:one\n1:one\n2:one\n2:one\n" \ testing "grep -vo" "grep -vo one input" "twothree\n" "onetwoonethreeone\n" "" testing "grep no newline" "grep -h one input -" \ "hello one\nthere one\n" "hello one" "there one" + +testing "grep -e multi" "grep -e one -ethree input" \ + "three\none\n" "three\ntwo\none\n" "" +# Suppress filenames for recursive test because dunno order they'd occur in +mkdir sub +echo -e "one\ntwo\nthree" > sub/one +echo -e "three\ntwo\none" > sub/two +testing "grep -r" "grep -hr one sub" "one\none\n" "" "" +rm -rf sub + +testing "grep -Fx ''" "grep -Fx '' input" "" "one one one\n" "" +testing "grep -F ''" "grep -F '' input" "one one one\n" "one one one\n" "" +testing "grep -w ''" "grep -w '' input" "" "one one one\n" "" +testing "grep -o ''" "grep -o '' input" "" "one one one\n" "" -- cgit v1.2.3