Lines Matching refs:testing
3 [ -f testing.sh ] && . testing.sh
10 testing "-c" "grep -c 123 input" "3\n" "123\ncount 123\n123\nfasdfasdf" ""
15 testing "-l" "grep -l test foo foo2 foo3" "foo\nfoo2\n" "" ""
18 testing "-q" "grep -q test input && echo yes" "yes\n" "this is a test\n" ""
19 testing "-E" "grep -E '[0-9]' input" "1234123asdfas123123\n1\n" \
21 testing "-e" "grep -e '[0-9]' input" "1234123asdfas123123\n1\n" \
23 testing "-e -e" "grep -e one -e two -e three input" \
25 testing "-F" "grep -F is input" "this is test\nthis is test2\n" \
31 testing "-H" "grep -H is foo foo2 foo3" "foo:this is test\nfoo:this is test2\nfoo2:hello this is te…
34 testing "-b" "grep -b is input" "0:this is test\n13:this is test2\n" \
36 testing "-i" "grep -i is input" "thisIs test\nthis is test2\n" \
38 testing "-n" "grep -n is input" "1:this is test\n2:this is test2\n" \
40 testing "-o" "grep -o is input" "is\nis\nis\nis\n" \
42 testing "-s" "grep -hs hello asdf input 2>&1" "hello\n" "hello\n" ""
43 testing "-v" "grep -v abc input" "1234123asdfas123123\n1ABa\n" \
45 testing "-w" "grep -w abc input" "abc\n123 abc\nabc 123\n123 abc 456\n" \
47 testing "-x" "grep -x abc input" "abc\n" \
50 testing "-H (standard input)" "grep -H abc" "(standard input):abc\n" \
52 testing "-l (standard input)" "grep -l abc" "(standard input)\n" \
54 testing "-n two inputs" "grep -hn def - input" "2:def\n2:def\n" \
57 testing "pattern with newline" "grep 'abc
61 testing "-lH" "grep -lH abc input" "input\n" "abc\n" ""
62 testing "-cn" "grep -cn abc input" "1\n" "abc\n" ""
63 testing "-cH" "grep -cH abc input" "input:1\n" "abc\n" ""
64 testing "-qs" "grep -qs abc none input && echo yes" "yes\n" "abc\n" ""
65 testing "-hl" "grep -hl abc input" "input\n" "abc\n" ""
66 testing "-b stdin" "grep -b one" "0:one\n4:one\n8:one\n" "" "one\none\none\n"
67 testing "-o overlap" "grep -bo aaa" "1:aaa\n" "" "baaaa\n"
69 testing "-co" "grep -co one input" "1\n" "one one one\n" ""
70 testing "-nom" "grep -nom 2 one" "1:one\n1:one\n1:one\n2:one\n2:one\n" \
72 toyonly testing "-vo" "grep -vo one input" "two\nthree\n" "onetwoonethreeone\n" ""
73 testing "no newline" "grep -h one input -" \
76 testing "-e multi" "grep -e one -ethree input" \
82 testing "-hr" "grep -hr one sub" "one\none\n" "" ""
83 testing "-r file" "grep -r three sub/two" "three\n" "" ""
84 testing "-r dir" "grep -r one sub | sort" "sub/one:one\nsub/two:one\n" \
89 testing "-Fx ''" "grep -Fx '' input" "" "one one one\n" ""
90 testing "-F ''" "grep -F '' input" "one one one\n" "one one one\n" ""
91 testing "-F -e blah -e ''" "grep -F -e blah -e '' input" "one one one\n" \
93 testing "-Fxv -e subset" "grep -Fxv -e bbswitch-dkms -e dkms" "" "" \
95 testing "-e blah -e ''" "grep -e blah -e '' input" "one one one\n" \
97 testing "-w ''" "grep -w '' input" "" "one one one\n" ""
98 testing "-w '' 2" "grep -w '' input" "one two\n" "one two\n" ""
99 testing "-w \\1" "grep -wo '\\(x\\)\\1'" "xx\n" "" "xx"
100 testing "-o ''" "grep -o '' input" "" "one one one\n" ""
101 testing "backref" 'grep -e "a\(b\)" -e "b\(c\)\1"' "bcc\nab\n" \
104 testing "-A" "grep -A 2 yes" "yes\nno\nno\n--\nyes\nno\nno\nyes\nno\n" \
106 testing "-B" "grep -B 1 yes" "no\nyes\n--\nno\nyes\nno\nyes\n" \
108 testing "-C" "grep -C 1 yes" \
111 testing "-HnC" "grep -HnC1 two" \
116 testing "-HnbB1" "grep -HnbB1 f input" \
120 testing "-q match overrides error" \
122 testing "-q not found is 1" \
124 testing "-q missing is 2" \
126 testing "-q missing survives exists but not found" \
128 testing "not found retained past match" \
132 testing "one match good enough for 0" \
136 testing "-o ''" "grep -o ''" "" "" "one two three\none two\none\n"
137 testing '' "grep -o -e '' -e two" "two\ntwo\n" "" \
141 testing "-l overrides -C" "grep -l -C1 two test input" "test\ninput\n" \
146 testing "match after NUL byte" "grep -a two" "one\0and two three\n" \
150 testing "implicit BRE |" "grep 'uno|dos'" "uno|dos\n" \
152 testing "explicit BRE |" "grep -e 'uno|dos'" "uno|dos\n" \
154 testing "explicit ERE |" "grep -E 'uno|dos'" "uno\ndos\nuno|dos\n" \
157 testing "" "grep -o -e iss -e ipp" "iss\niss\nipp\n" "" "mississippi"
158 testing "" "grep -o -e gum -e rgu" "rgu\n" "" "argument"
160 testing "early failure" 'grep --what 2>/dev/null || echo $?' "2\n" "" ""
162 testing "" 'grep abc ; echo $?' "abcdef\n0\n" "" "abcdef\n"
163 testing "" 'grep abc doesnotexist input 2>/dev/null; echo $?' \
167 testing "" 'grep -r walrus sub 2>/dev/null; echo $?' "1\n" "" ""
176 testing "--exclude-dir" 'grep --exclude-dir=no -r world sub' "sub/yes/test:hello world\n" "" ""
184 testing "" "grep -rh hello sub 2>/dev/null || echo err" "err\n" "" ""
185 testing "" "grep -Rh hello sub" "hello\n" "" ""
189 testing "-F multiple" "grep -F h input" "this is hello\nthis is world\n" \
191 testing "-Fi multiple" "grep -Fi h input" "this is HELLO\nthis is WORLD\n" \
193 testing "-F empty multiple" "grep -Fi '' input" \
196 testing "-Fx" "grep -Fx h input" "h\n" \
198 testing "-Fix" "grep -Fix h input" "H\nh\n" \
200 testing "-f /dev/null" "grep -f /dev/null" "" "" "hello\n"
201 testing "-z with \n in pattern" "grep -f input" "hi\nthere\n" "i\nt" "hi\nthere"
203 testing "print zero length match" "grep '[0-9]*'" "abc\n" "" "abc\n"
204 testing "-o skip zero length match" "grep -o '[0-9]*'" "1234\n" "" "a1234b"