aboutsummaryrefslogtreecommitdiff
path: root/scripts/test/grep.test
diff options
context:
space:
mode:
authorRob Landley <rob@landley.net>2013-08-11 01:03:26 -0500
committerRob Landley <rob@landley.net>2013-08-11 01:03:26 -0500
commit133cc5b85f3363bf0c252a3f8bf6fd259177b066 (patch)
treeff296ff1fdaf882ac3d78cc3e8954a48b673a14c /scripts/test/grep.test
parente49fe14705f78ba5a865ca4efd6ee53c78eeb253 (diff)
downloadtoybox-133cc5b85f3363bf0c252a3f8bf6fd259177b066.tar.gz
More grep tests.
Diffstat (limited to 'scripts/test/grep.test')
-rwxr-xr-xscripts/test/grep.test14
1 files changed, 14 insertions, 0 deletions
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" ""