summaryrefslogtreecommitdiff
path: root/t/t7810-grep.sh
diff options
context:
space:
mode:
authorMichael J Gruber <git@drmicha.warpmail.net>2012-09-14 09:46:42 (GMT)
committerJunio C Hamano <gitster@pobox.com>2012-09-16 06:35:40 (GMT)
commit2cb03e76a0e65920a0790d5b128fde9185e0e8fe (patch)
tree0c0973302bad66a00c795ac72754f5f950bc2e6d /t/t7810-grep.sh
parent00f62a64d489592c97f6f171f9a19fdda530f3c5 (diff)
downloadgit-2cb03e76a0e65920a0790d5b128fde9185e0e8fe.zip
git-2cb03e76a0e65920a0790d5b128fde9185e0e8fe.tar.gz
git-2cb03e76a0e65920a0790d5b128fde9185e0e8fe.tar.bz2
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>
Diffstat (limited to 't/t7810-grep.sh')
-rwxr-xr-xt/t7810-grep.sh38
1 files changed, 22 insertions, 16 deletions
diff --git a/t/t7810-grep.sh b/t/t7810-grep.sh
index be81d96..f6edb4d 100755
--- a/t/t7810-grep.sh
+++ b/t/t7810-grep.sh
@@ -495,16 +495,6 @@ test_expect_success 'log --all-match with multiple --grep uses intersection' '
test_cmp expect actual
'
-test_expect_success 'log --grep --author implicitly uses all-match' '
- # grep matches initial and second but not third
- # author matches only initial and third
- git log --author="A U Thor" --grep=s --grep=l --format=%s >actual &&
- {
- echo initial
- } >expect &&
- test_cmp expect actual
-'
-
test_expect_success 'log with multiple --author uses union' '
git log --author="Thor" --author="Aster" --format=%s >actual &&
{
@@ -521,17 +511,33 @@ test_expect_success 'log --all-match with multiple --author still uses union' '
test_cmp expect actual
'
-test_expect_success 'log with --grep and multiple --author uses all-match' '
- git log --author="Thor" --author="Night" --grep=i --format=%s >actual &&
+test_expect_success 'log --grep --author uses intersection' '
+ # grep matches only third and fourth
+ # author matches only initial and third
+ git log --author="A U Thor" --grep=r --format=%s >actual &&
{
- echo third && echo initial
+ echo third
} >expect &&
test_cmp expect actual
'
-test_expect_success 'log with --grep and multiple --author uses all-match' '
- git log --author="Thor" --author="Night" --grep=q --format=%s >actual &&
- >expect &&
+test_expect_success 'log --grep --grep --author takes union of greps and intersects with author' '
+ # grep matches initial and second but not third
+ # author matches only initial and third
+ git log --author="A U Thor" --grep=s --grep=l --format=%s >actual &&
+ {
+ echo initial
+ } >expect &&
+ test_cmp expect actual
+'
+
+test_expect_success 'log --grep --author --author takes union of authors and intersects with grep' '
+ # grep matches only initial and third
+ # author matches all but second
+ git log --author="Thor" --author="Night" --grep=i --format=%s >actual &&
+ {
+ echo third && echo initial
+ } >expect &&
test_cmp expect actual
'