Skip to content

Commit

Permalink
t7810-grep: bring log --grep tests in common form
Browse files Browse the repository at this point in the history
The log --grep tests generate the expected out in different ways.
Make them all use command blocks so that subshells are avoided and the
expected output is easier to grasp visually.

Signed-off-by: Michael J Gruber <git@drmicha.warpmail.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
  • Loading branch information
Michael J Gruber authored and Junio C Hamano committed Sep 16, 2012
1 parent 07a7d65 commit b327bf7
Showing 1 changed file with 18 additions and 6 deletions.
24 changes: 18 additions & 6 deletions t/t7810-grep.sh
Original file line number Diff line number Diff line change
Expand Up @@ -435,31 +435,41 @@ test_expect_success 'log grep setup' '

test_expect_success 'log grep (1)' '
git log --author=author --pretty=tformat:%s >actual &&
( echo third ; echo initial ) >expect &&
{
echo third && echo initial
} >expect &&
test_cmp expect actual
'

test_expect_success 'log grep (2)' '
git log --author=" * " -F --pretty=tformat:%s >actual &&
( echo second ) >expect &&
{
echo second
} >expect &&
test_cmp expect actual
'

test_expect_success 'log grep (3)' '
git log --author="^A U" --pretty=tformat:%s >actual &&
( echo third ; echo initial ) >expect &&
{
echo third && echo initial
} >expect &&
test_cmp expect actual
'

test_expect_success 'log grep (4)' '
git log --author="frotz\.com>$" --pretty=tformat:%s >actual &&
( echo second ) >expect &&
{
echo second
} >expect &&
test_cmp expect actual
'

test_expect_success 'log grep (5)' '
git log --author=Thor -F --pretty=tformat:%s >actual &&
( echo third ; echo initial ) >expect &&
{
echo third && echo initial
} >expect &&
test_cmp expect actual
'

Expand All @@ -473,7 +483,9 @@ 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 &&
{
echo initial
} >expect &&
test_cmp expect actual
'

Expand Down

0 comments on commit b327bf7

Please sign in to comment.