t7810-grep: test interaction of multiple --grep and --author options
There are tests for this interaction already. Restructure slightly and avoid any claims about --all-match. Signed-off-by: Michael J Gruber <git@drmicha.warpmail.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Michael J Gruber committed
Sep 14, 2012 at 11:46 UTC
2cb03e76a0e65920a0790d5b128fde9185e0e8fe
1 file changed
+22
-16
t/t7810-grep.sh
+22
-16
@@ -495,16 +495,6 @@ test_expect_success 'log --all-match with multiple --grep uses intersection' '
495
test_cmp expect actual
496
'
497
498
-test_expect_success 'log --grep --author implicitly uses all-match' '
499
- # grep matches initial and second but not third
500
- # author matches only initial and third
501
- git log --author="A U Thor" --grep=s --grep=l --format=%s >actual &&
502
- {
503
- echo initial
504
- } >expect &&
505
- test_cmp expect actual
506
-'
507
-
498
test_expect_success 'log with multiple --author uses union' '
499
git log --author="Thor" --author="Aster" --format=%s >actual &&
500
{
@@ -521,17 +511,33 @@ test_expect_success 'log --all-match with multiple --author still uses union' '
511
test_cmp expect actual
512
'
513
524
-test_expect_success 'log with --grep and multiple --author uses all-match' '
525
- git log --author="Thor" --author="Night" --grep=i --format=%s >actual &&
514
+test_expect_success 'log --grep --author uses intersection' '
515
+ # grep matches only third and fourth
516
+ # author matches only initial and third
517
+ git log --author="A U Thor" --grep=r --format=%s >actual &&
518
{
527
- echo third && echo initial
519
+ echo third
520
} >expect &&
521
test_cmp expect actual
522
'
523
532
-test_expect_success 'log with --grep and multiple --author uses all-match' '
533
- git log --author="Thor" --author="Night" --grep=q --format=%s >actual &&
534
- >expect &&
524
+test_expect_success 'log --grep --grep --author takes union of greps and intersects with author' '
525
+ # grep matches initial and second but not third
526
+ # author matches only initial and third
527
+ git log --author="A U Thor" --grep=s --grep=l --format=%s >actual &&
528
+ {
529
+ echo initial
530
+ } >expect &&
531
+ test_cmp expect actual
532
+'
533
+
534
+test_expect_success 'log --grep --author --author takes union of authors and intersects with grep' '
535
+ # grep matches only initial and third
536
+ # author matches all but second
537
+ git log --author="Thor" --author="Night" --grep=i --format=%s >actual &&
538
+ {
539
+ echo third && echo initial
540
+ } >expect &&
541
test_cmp expect actual
542
'
543