t7810-*.sh: Remove redundant test
[git/jnareb-git.git] / t / t7810-grep.sh
blobcd32ac5eb5b56a02b70d5e348c0f2630d0da9ae9
1 #!/bin/sh
3 # Copyright (c) 2006 Junio C Hamano
6 test_description='git grep various.
9 . ./test-lib.sh
11 cat >hello.c <<EOF
12 #include <stdio.h>
13 int main(int argc, const char **argv)
15 printf("Hello world.\n");
16 return 0;
17 /* char ?? */
19 EOF
21 test_expect_success setup '
23 echo foo mmap bar
24 echo foo_mmap bar
25 echo foo_mmap bar mmap
26 echo foo mmap bar_mmap
27 echo foo_mmap bar mmap baz
28 } >file &&
30 echo Hello world
31 echo HeLLo world
32 echo Hello_world
33 echo HeLLo_world
34 } >hello_world &&
36 echo "a+b*c"
37 echo "a+bc"
38 echo "abc"
39 } >ab &&
40 echo vvv >v &&
41 echo ww w >w &&
42 echo x x xx x >x &&
43 echo y yy >y &&
44 echo zzz > z &&
45 mkdir t &&
46 echo test >t/t &&
47 echo vvv >t/v &&
48 mkdir t/a &&
49 echo vvv >t/a/v &&
50 git add . &&
51 test_tick &&
52 git commit -m initial
55 test_expect_success 'grep should not segfault with a bad input' '
56 test_must_fail git grep "("
59 for H in HEAD ''
61 case "$H" in
62 HEAD) HC='HEAD:' L='HEAD' ;;
63 '') HC= L='in working tree' ;;
64 esac
66 test_expect_success "grep -w $L" '
68 echo ${HC}file:1:foo mmap bar
69 echo ${HC}file:3:foo_mmap bar mmap
70 echo ${HC}file:4:foo mmap bar_mmap
71 echo ${HC}file:5:foo_mmap bar mmap baz
72 } >expected &&
73 git -c grep.linenumber=false grep -n -w -e mmap $H >actual &&
74 test_cmp expected actual
77 test_expect_success "grep -w $L" '
79 echo ${HC}file:1:foo mmap bar
80 echo ${HC}file:3:foo_mmap bar mmap
81 echo ${HC}file:4:foo mmap bar_mmap
82 echo ${HC}file:5:foo_mmap bar mmap baz
83 } >expected &&
84 git -c grep.linenumber=true grep -w -e mmap $H >actual &&
85 test_cmp expected actual
88 test_expect_success "grep -w $L" '
90 echo ${HC}file:foo mmap bar
91 echo ${HC}file:foo_mmap bar mmap
92 echo ${HC}file:foo mmap bar_mmap
93 echo ${HC}file:foo_mmap bar mmap baz
94 } >expected &&
95 git -c grep.linenumber=true grep --no-line-number -w -e mmap $H >actual &&
96 test_cmp expected actual
99 test_expect_success "grep -w $L (w)" '
100 : >expected &&
101 test_must_fail git grep -n -w -e "^w" >actual &&
102 test_cmp expected actual
105 test_expect_success "grep -w $L (x)" '
107 echo ${HC}x:1:x x xx x
108 } >expected &&
109 git grep -n -w -e "x xx* x" $H >actual &&
110 test_cmp expected actual
113 test_expect_success "grep -w $L (y-1)" '
115 echo ${HC}y:1:y yy
116 } >expected &&
117 git grep -n -w -e "^y" $H >actual &&
118 test_cmp expected actual
121 test_expect_success "grep -w $L (y-2)" '
122 : >expected &&
123 if git grep -n -w -e "^y y" $H >actual
124 then
125 echo should not have matched
126 cat actual
127 false
128 else
129 test_cmp expected actual
133 test_expect_success "grep -w $L (z)" '
134 : >expected &&
135 if git grep -n -w -e "^z" $H >actual
136 then
137 echo should not have matched
138 cat actual
139 false
140 else
141 test_cmp expected actual
145 test_expect_success "grep $L (t-1)" '
146 echo "${HC}t/t:1:test" >expected &&
147 git grep -n -e test $H >actual &&
148 test_cmp expected actual
151 test_expect_success "grep $L (t-2)" '
152 echo "${HC}t:1:test" >expected &&
154 cd t &&
155 git grep -n -e test $H
156 ) >actual &&
157 test_cmp expected actual
160 test_expect_success "grep $L (t-3)" '
161 echo "${HC}t/t:1:test" >expected &&
163 cd t &&
164 git grep --full-name -n -e test $H
165 ) >actual &&
166 test_cmp expected actual
169 test_expect_success "grep -c $L (no /dev/null)" '
170 ! git grep -c test $H | grep /dev/null
173 test_expect_success "grep --max-depth -1 $L" '
175 echo ${HC}t/a/v:1:vvv
176 echo ${HC}t/v:1:vvv
177 echo ${HC}v:1:vvv
178 } >expected &&
179 git grep --max-depth -1 -n -e vvv $H >actual &&
180 test_cmp expected actual
183 test_expect_success "grep --max-depth 0 $L" '
185 echo ${HC}v:1:vvv
186 } >expected &&
187 git grep --max-depth 0 -n -e vvv $H >actual &&
188 test_cmp expected actual
191 test_expect_success "grep --max-depth 0 -- '*' $L" '
193 echo ${HC}t/a/v:1:vvv
194 echo ${HC}t/v:1:vvv
195 echo ${HC}v:1:vvv
196 } >expected &&
197 git grep --max-depth 0 -n -e vvv $H -- "*" >actual &&
198 test_cmp expected actual
201 test_expect_success "grep --max-depth 1 $L" '
203 echo ${HC}t/v:1:vvv
204 echo ${HC}v:1:vvv
205 } >expected &&
206 git grep --max-depth 1 -n -e vvv $H >actual &&
207 test_cmp expected actual
210 test_expect_success "grep --max-depth 0 -- t $L" '
212 echo ${HC}t/v:1:vvv
213 } >expected &&
214 git grep --max-depth 0 -n -e vvv $H -- t >actual &&
215 test_cmp expected actual
218 test_expect_success "grep --max-depth 0 -- . t $L" '
220 echo ${HC}t/v:1:vvv
221 echo ${HC}v:1:vvv
222 } >expected &&
223 git grep --max-depth 0 -n -e vvv $H -- . t >actual &&
224 test_cmp expected actual
227 test_expect_success "grep --max-depth 0 -- t . $L" '
229 echo ${HC}t/v:1:vvv
230 echo ${HC}v:1:vvv
231 } >expected &&
232 git grep --max-depth 0 -n -e vvv $H -- t . >actual &&
233 test_cmp expected actual
235 test_expect_success "grep $L with grep.extendedRegexp=false" '
236 echo "ab:a+bc" >expected &&
237 git -c grep.extendedRegexp=false grep "a+b*c" ab >actual &&
238 test_cmp expected actual
241 test_expect_success "grep $L with grep.extendedRegexp=true" '
242 echo "ab:abc" >expected &&
243 git -c grep.extendedRegexp=true grep "a+b*c" ab >actual &&
244 test_cmp expected actual
246 done
248 cat >expected <<EOF
249 file
251 test_expect_success 'grep -l -C' '
252 git grep -l -C1 foo >actual &&
253 test_cmp expected actual
256 cat >expected <<EOF
257 file:5
259 test_expect_success 'grep -l -C' '
260 git grep -c -C1 foo >actual &&
261 test_cmp expected actual
264 test_expect_success 'grep -L -C' '
265 git ls-files >expected &&
266 git grep -L -C1 nonexistent_string >actual &&
267 test_cmp expected actual
270 cat >expected <<EOF
271 file:foo mmap bar_mmap
274 test_expect_success 'grep -e A --and -e B' '
275 git grep -e "foo mmap" --and -e bar_mmap >actual &&
276 test_cmp expected actual
279 cat >expected <<EOF
280 file:foo_mmap bar mmap
281 file:foo_mmap bar mmap baz
285 test_expect_success 'grep ( -e A --or -e B ) --and -e B' '
286 git grep \( -e foo_ --or -e baz \) \
287 --and -e " mmap" >actual &&
288 test_cmp expected actual
291 cat >expected <<EOF
292 file:foo mmap bar
295 test_expect_success 'grep -e A --and --not -e B' '
296 git grep -e "foo mmap" --and --not -e bar_mmap >actual &&
297 test_cmp expected actual
300 test_expect_success 'grep should ignore GREP_OPTIONS' '
301 GREP_OPTIONS=-v git grep " mmap bar\$" >actual &&
302 test_cmp expected actual
305 test_expect_success 'grep -f, non-existent file' '
306 test_must_fail git grep -f patterns
309 cat >expected <<EOF
310 file:foo mmap bar
311 file:foo_mmap bar
312 file:foo_mmap bar mmap
313 file:foo mmap bar_mmap
314 file:foo_mmap bar mmap baz
317 cat >pattern <<EOF
318 mmap
321 test_expect_success 'grep -f, one pattern' '
322 git grep -f pattern >actual &&
323 test_cmp expected actual
326 cat >expected <<EOF
327 file:foo mmap bar
328 file:foo_mmap bar
329 file:foo_mmap bar mmap
330 file:foo mmap bar_mmap
331 file:foo_mmap bar mmap baz
332 t/a/v:vvv
333 t/v:vvv
334 v:vvv
337 cat >patterns <<EOF
338 mmap
342 test_expect_success 'grep -f, multiple patterns' '
343 git grep -f patterns >actual &&
344 test_cmp expected actual
347 cat >expected <<EOF
348 file:foo mmap bar
349 file:foo_mmap bar
350 file:foo_mmap bar mmap
351 file:foo mmap bar_mmap
352 file:foo_mmap bar mmap baz
353 t/a/v:vvv
354 t/v:vvv
355 v:vvv
358 cat >patterns <<EOF
360 mmap
366 test_expect_success 'grep -f, ignore empty lines' '
367 git grep -f patterns >actual &&
368 test_cmp expected actual
371 test_expect_success 'grep -f, ignore empty lines, read patterns from stdin' '
372 git grep -f - <patterns >actual &&
373 test_cmp expected actual
376 cat >expected <<EOF
377 y:y yy
379 z:zzz
382 test_expect_success 'grep -q, silently report matches' '
383 >empty &&
384 git grep -q mmap >actual &&
385 test_cmp empty actual &&
386 test_must_fail git grep -q qfwfq >actual &&
387 test_cmp empty actual
390 test_expect_success 'grep -C1 hunk mark between files' '
391 git grep -C1 "^[yz]" >actual &&
392 test_cmp expected actual
395 test_expect_success 'log grep setup' '
396 echo a >>file &&
397 test_tick &&
398 GIT_AUTHOR_NAME="With * Asterisk" \
399 GIT_AUTHOR_EMAIL="xyzzy@frotz.com" \
400 git commit -a -m "second" &&
402 echo a >>file &&
403 test_tick &&
404 git commit -a -m "third" &&
406 echo a >>file &&
407 test_tick &&
408 GIT_AUTHOR_NAME="Night Fall" \
409 GIT_AUTHOR_EMAIL="nitfol@frobozz.com" \
410 git commit -a -m "fourth"
413 test_expect_success 'log grep (1)' '
414 git log --author=author --pretty=tformat:%s >actual &&
415 ( echo third ; echo initial ) >expect &&
416 test_cmp expect actual
419 test_expect_success 'log grep (2)' '
420 git log --author=" * " -F --pretty=tformat:%s >actual &&
421 ( echo second ) >expect &&
422 test_cmp expect actual
425 test_expect_success 'log grep (3)' '
426 git log --author="^A U" --pretty=tformat:%s >actual &&
427 ( echo third ; echo initial ) >expect &&
428 test_cmp expect actual
431 test_expect_success 'log grep (4)' '
432 git log --author="frotz\.com>$" --pretty=tformat:%s >actual &&
433 ( echo second ) >expect &&
434 test_cmp expect actual
437 test_expect_success 'log grep (5)' '
438 git log --author=Thor -F --pretty=tformat:%s >actual &&
439 ( echo third ; echo initial ) >expect &&
440 test_cmp expect actual
443 test_expect_success 'log grep (6)' '
444 git log --author=-0700 --pretty=tformat:%s >actual &&
445 >expect &&
446 test_cmp expect actual
449 test_expect_success 'log --grep --author implicitly uses all-match' '
450 # grep matches initial and second but not third
451 # author matches only initial and third
452 git log --author="A U Thor" --grep=s --grep=l --format=%s >actual &&
453 echo initial >expect &&
454 test_cmp expect actual
457 test_expect_success 'log with multiple --author uses union' '
458 git log --author="Thor" --author="Aster" --format=%s >actual &&
460 echo third && echo second && echo initial
461 } >expect &&
462 test_cmp expect actual
465 test_expect_success 'log with --grep and multiple --author uses all-match' '
466 git log --author="Thor" --author="Night" --grep=i --format=%s >actual &&
468 echo third && echo initial
469 } >expect &&
470 test_cmp expect actual
473 test_expect_success 'log with --grep and multiple --author uses all-match' '
474 git log --author="Thor" --author="Night" --grep=q --format=%s >actual &&
475 >expect &&
476 test_cmp expect actual
479 test_expect_success 'grep with CE_VALID file' '
480 git update-index --assume-unchanged t/t &&
481 rm t/t &&
482 test "$(git grep test)" = "t/t:test" &&
483 git update-index --no-assume-unchanged t/t &&
484 git checkout t/t
487 cat >expected <<EOF
488 hello.c=#include <stdio.h>
489 hello.c: return 0;
492 test_expect_success 'grep -p with userdiff' '
493 git config diff.custom.funcname "^#" &&
494 echo "hello.c diff=custom" >.gitattributes &&
495 git grep -p return >actual &&
496 test_cmp expected actual
499 cat >expected <<EOF
500 hello.c=int main(int argc, const char **argv)
501 hello.c: return 0;
504 test_expect_success 'grep -p' '
505 rm -f .gitattributes &&
506 git grep -p return >actual &&
507 test_cmp expected actual
510 cat >expected <<EOF
511 hello.c-#include <stdio.h>
512 hello.c=int main(int argc, const char **argv)
513 hello.c-{
514 hello.c- printf("Hello world.\n");
515 hello.c: return 0;
518 test_expect_success 'grep -p -B5' '
519 git grep -p -B5 return >actual &&
520 test_cmp expected actual
523 cat >expected <<EOF
524 hello.c=int main(int argc, const char **argv)
525 hello.c-{
526 hello.c- printf("Hello world.\n");
527 hello.c: return 0;
528 hello.c- /* char ?? */
529 hello.c-}
532 test_expect_success 'grep -W' '
533 git grep -W return >actual &&
534 test_cmp expected actual
537 cat >expected <<EOF
538 hello.c= printf("Hello world.\n");
539 hello.c: return 0;
540 hello.c- /* char ?? */
543 test_expect_success 'grep -W with userdiff' '
544 test_when_finished "rm -f .gitattributes" &&
545 git config diff.custom.xfuncname "(printf.*|})$" &&
546 echo "hello.c diff=custom" >.gitattributes &&
547 git grep -W return >actual &&
548 test_cmp expected actual
551 test_expect_success 'grep from a subdirectory to search wider area (1)' '
552 mkdir -p s &&
554 cd s && git grep "x x x" ..
558 test_expect_success 'grep from a subdirectory to search wider area (2)' '
559 mkdir -p s &&
561 cd s || exit 1
562 ( git grep xxyyzz .. >out ; echo $? >status )
563 ! test -s out &&
564 test 1 = $(cat status)
568 cat >expected <<EOF
569 hello.c:int main(int argc, const char **argv)
572 test_expect_success 'grep -Fi' '
573 git grep -Fi "CHAR *" >actual &&
574 test_cmp expected actual
577 test_expect_success 'outside of git repository' '
578 rm -fr non &&
579 mkdir -p non/git/sub &&
580 echo hello >non/git/file1 &&
581 echo world >non/git/sub/file2 &&
583 echo file1:hello &&
584 echo sub/file2:world
585 } >non/expect.full &&
586 echo file2:world >non/expect.sub &&
588 GIT_CEILING_DIRECTORIES="$(pwd)/non/git" &&
589 export GIT_CEILING_DIRECTORIES &&
590 cd non/git &&
591 test_must_fail git grep o &&
592 git grep --no-index o >../actual.full &&
593 test_cmp ../expect.full ../actual.full
594 cd sub &&
595 test_must_fail git grep o &&
596 git grep --no-index o >../../actual.sub &&
597 test_cmp ../../expect.sub ../../actual.sub
598 ) &&
600 echo ".*o*" >non/git/.gitignore &&
602 GIT_CEILING_DIRECTORIES="$(pwd)/non/git" &&
603 export GIT_CEILING_DIRECTORIES &&
604 cd non/git &&
605 test_must_fail git grep o &&
606 git grep --no-index --exclude-standard o >../actual.full &&
607 test_cmp ../expect.full ../actual.full &&
610 echo ".gitignore:.*o*"
611 cat ../expect.full
612 } >../expect.with.ignored &&
613 git grep --no-index --no-exclude o >../actual.full &&
614 test_cmp ../expect.with.ignored ../actual.full
618 test_expect_success 'inside git repository but with --no-index' '
619 rm -fr is &&
620 mkdir -p is/git/sub &&
621 echo hello >is/git/file1 &&
622 echo world >is/git/sub/file2 &&
623 echo ".*o*" >is/git/.gitignore &&
625 echo file1:hello &&
626 echo sub/file2:world
627 } >is/expect.unignored &&
629 echo ".gitignore:.*o*" &&
630 cat is/expect.unignored
631 } >is/expect.full &&
632 : >is/expect.empty &&
633 echo file2:world >is/expect.sub &&
635 cd is/git &&
636 git init &&
637 test_must_fail git grep o >../actual.full &&
638 test_cmp ../expect.empty ../actual.full &&
640 git grep --untracked o >../actual.unignored &&
641 test_cmp ../expect.unignored ../actual.unignored &&
643 git grep --no-index o >../actual.full &&
644 test_cmp ../expect.full ../actual.full &&
646 git grep --no-index --exclude-standard o >../actual.unignored &&
647 test_cmp ../expect.unignored ../actual.unignored &&
649 cd sub &&
650 test_must_fail git grep o >../../actual.sub &&
651 test_cmp ../../expect.empty ../../actual.sub &&
653 git grep --no-index o >../../actual.sub &&
654 test_cmp ../../expect.sub ../../actual.sub &&
656 git grep --untracked o >../../actual.sub &&
657 test_cmp ../../expect.sub ../../actual.sub
661 test_expect_success 'setup double-dash tests' '
662 cat >double-dash <<EOF &&
665 other
667 git add double-dash
670 cat >expected <<EOF
671 double-dash:->
673 test_expect_success 'grep -- pattern' '
674 git grep -- "->" >actual &&
675 test_cmp expected actual
677 test_expect_success 'grep -- pattern -- pathspec' '
678 git grep -- "->" -- double-dash >actual &&
679 test_cmp expected actual
681 test_expect_success 'grep -e pattern -- path' '
682 git grep -e "->" -- double-dash >actual &&
683 test_cmp expected actual
686 cat >expected <<EOF
687 double-dash:--
689 test_expect_success 'grep -e -- -- path' '
690 git grep -e -- -- double-dash >actual &&
691 test_cmp expected actual
694 cat >expected <<EOF
695 hello.c:int main(int argc, const char **argv)
696 hello.c: printf("Hello world.\n");
699 test_expect_success LIBPCRE 'grep --perl-regexp pattern' '
700 git grep --perl-regexp "\p{Ps}.*?\p{Pe}" hello.c >actual &&
701 test_cmp expected actual
704 test_expect_success LIBPCRE 'grep -P pattern' '
705 git grep -P "\p{Ps}.*?\p{Pe}" hello.c >actual &&
706 test_cmp expected actual
709 test_expect_success 'grep pattern with grep.extendedRegexp=true' '
710 >empty &&
711 test_must_fail git -c grep.extendedregexp=true \
712 grep "\p{Ps}.*?\p{Pe}" hello.c >actual &&
713 test_cmp empty actual
716 test_expect_success LIBPCRE 'grep -P pattern with grep.extendedRegexp=true' '
717 git -c grep.extendedregexp=true \
718 grep -P "\p{Ps}.*?\p{Pe}" hello.c >actual &&
719 test_cmp expected actual
722 test_expect_success LIBPCRE 'grep -P -v pattern' '
724 echo "ab:a+b*c"
725 echo "ab:a+bc"
726 } >expected &&
727 git grep -P -v "abc" ab >actual &&
728 test_cmp expected actual
731 test_expect_success LIBPCRE 'grep -P -i pattern' '
732 cat >expected <<-EOF &&
733 hello.c: printf("Hello world.\n");
735 git grep -P -i "PRINTF\([^\d]+\)" hello.c >actual &&
736 test_cmp expected actual
739 test_expect_success LIBPCRE 'grep -P -w pattern' '
741 echo "hello_world:Hello world"
742 echo "hello_world:HeLLo world"
743 } >expected &&
744 git grep -P -w "He((?i)ll)o" hello_world >actual &&
745 test_cmp expected actual
748 test_expect_success 'grep -G invalidpattern properly dies ' '
749 test_must_fail git grep -G "a["
752 test_expect_success 'grep -E invalidpattern properly dies ' '
753 test_must_fail git grep -E "a["
756 test_expect_success LIBPCRE 'grep -P invalidpattern properly dies ' '
757 test_must_fail git grep -P "a["
760 test_expect_success 'grep -G -E -F pattern' '
761 echo "ab:a+b*c" >expected &&
762 git grep -G -E -F "a+b*c" ab >actual &&
763 test_cmp expected actual
766 test_expect_success 'grep -E -F -G pattern' '
767 echo "ab:a+bc" >expected &&
768 git grep -E -F -G "a+b*c" ab >actual &&
769 test_cmp expected actual
772 test_expect_success 'grep -F -G -E pattern' '
773 echo "ab:abc" >expected &&
774 git grep -F -G -E "a+b*c" ab >actual &&
775 test_cmp expected actual
778 test_expect_success 'grep -G -F -P -E pattern' '
779 >empty &&
780 test_must_fail git grep -G -F -P -E "a\x{2b}b\x{2a}c" ab >actual &&
781 test_cmp empty actual
784 test_expect_success LIBPCRE 'grep -G -F -E -P pattern' '
785 echo "ab:a+b*c" >expected &&
786 git grep -G -F -E -P "a\x{2b}b\x{2a}c" ab >actual &&
787 test_cmp expected actual
790 test_config() {
791 git config "$1" "$2" &&
792 test_when_finished "git config --unset $1"
795 cat >expected <<EOF
796 hello.c<RED>:<RESET>int main(int argc, const char **argv)
797 hello.c<RED>-<RESET>{
798 <RED>--<RESET>
799 hello.c<RED>:<RESET> /* char ?? */
800 hello.c<RED>-<RESET>}
801 <RED>--<RESET>
802 hello_world<RED>:<RESET>Hello_world
803 hello_world<RED>-<RESET>HeLLo_world
806 test_expect_success 'grep --color, separator' '
807 test_config color.grep.context normal &&
808 test_config color.grep.filename normal &&
809 test_config color.grep.function normal &&
810 test_config color.grep.linenumber normal &&
811 test_config color.grep.match normal &&
812 test_config color.grep.selected normal &&
813 test_config color.grep.separator red &&
815 git grep --color=always -A1 -e char -e lo_w hello.c hello_world |
816 test_decode_color >actual &&
817 test_cmp expected actual
820 cat >expected <<EOF
821 hello.c:int main(int argc, const char **argv)
822 hello.c: /* char ?? */
824 hello_world:Hello_world
827 test_expect_success 'grep --break' '
828 git grep --break -e char -e lo_w hello.c hello_world >actual &&
829 test_cmp expected actual
832 cat >expected <<EOF
833 hello.c:int main(int argc, const char **argv)
834 hello.c-{
836 hello.c: /* char ?? */
837 hello.c-}
839 hello_world:Hello_world
840 hello_world-HeLLo_world
843 test_expect_success 'grep --break with context' '
844 git grep --break -A1 -e char -e lo_w hello.c hello_world >actual &&
845 test_cmp expected actual
848 cat >expected <<EOF
849 hello.c
850 int main(int argc, const char **argv)
851 /* char ?? */
852 hello_world
853 Hello_world
856 test_expect_success 'grep --heading' '
857 git grep --heading -e char -e lo_w hello.c hello_world >actual &&
858 test_cmp expected actual
861 cat >expected <<EOF
862 <BOLD;GREEN>hello.c<RESET>
863 2:int main(int argc, const <BLACK;BYELLOW>char<RESET> **argv)
864 6: /* <BLACK;BYELLOW>char<RESET> ?? */
866 <BOLD;GREEN>hello_world<RESET>
867 3:Hel<BLACK;BYELLOW>lo_w<RESET>orld
870 test_expect_success 'mimic ack-grep --group' '
871 test_config color.grep.context normal &&
872 test_config color.grep.filename "bold green" &&
873 test_config color.grep.function normal &&
874 test_config color.grep.linenumber normal &&
875 test_config color.grep.match "black yellow" &&
876 test_config color.grep.selected normal &&
877 test_config color.grep.separator normal &&
879 git grep --break --heading -n --color \
880 -e char -e lo_w hello.c hello_world |
881 test_decode_color >actual &&
882 test_cmp expected actual
885 test_done