aboutsummaryrefslogtreecommitdiff
path: root/tests/grep.test
diff options
context:
space:
mode:
authorRob Landley <rob@landley.net>2016-02-04 14:10:36 -0600
committerRob Landley <rob@landley.net>2016-02-04 14:10:36 -0600
commitc02619bbc0acbb2b4588933ec1bbb7b7026adbb6 (patch)
tree3f53e640342f45a1199442a1c90a5300f797bdca /tests/grep.test
parentf42356f850c64fb3b2cd23595789fb4daf03f35b (diff)
downloadtoybox-c02619bbc0acbb2b4588933ec1bbb7b7026adbb6.tar.gz
Fix -H and -n with -ABC, and add tests.
Diffstat (limited to 'tests/grep.test')
-rwxr-xr-xtests/grep.test4
1 files changed, 4 insertions, 0 deletions
diff --git a/tests/grep.test b/tests/grep.test
index aa11c704..4b52b5b4 100755
--- a/tests/grep.test
+++ b/tests/grep.test
@@ -60,6 +60,7 @@ def' input" "aabcc\nddeff\n" \
testing "grep -lH" "grep -lH abc input" "input\n" "abc\n" ""
testing "grep -cn" "grep -cn abc input" "1\n" "abc\n" ""
+testing "grep -cH" "grep -cH abc input" "input:1\n" "abc\n" ""
testing "grep -qs" "grep -qs abc none input && echo yes" "yes\n" "abc\n" ""
testing "grep -hl" "grep -hl abc input" "input\n" "abc\n" ""
testing "grep -b stdin" "grep -b one" "0:one\n4:one\n8:one\n" "" "one\none\none\n"
@@ -105,3 +106,6 @@ testing "grep -B" "grep -B 1 yes" "no\nyes\n--\nno\nyes\nno\nyes\n" \
testing "grep -C" "grep -C 1 yes" \
"yes\nno\n--\nno\nyes\nno\nno\nyes\nno\nyes\nno\n" \
"" "yes\nno\nno\nno\nyes\nno\nno\nyes\nno\nyes\nno\nno"
+testing "grep -HnC" "grep -HnC1 two" \
+ "(standard input)-1-one\n(standard input):2:two\n(standard input)-3-three\n" \
+ "" "one\ntwo\nthree"