t7810: use test_expect_code() instead of hand-rolled comparison
This test manually checks the exit code of git-grep for a particular value. In doing so, it intentionally breaks the &&-chain. Modernize the test by taking advantage of test_expect_code() and a normal &&-chain. Signed-off-by: Eric Sunshine <sunshine@sunshineco.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:
parent
adc73318fe
commit
d964def526
@ -845,10 +845,9 @@ test_expect_success 'grep from a subdirectory to search wider area (1)' '
|
|||||||
test_expect_success 'grep from a subdirectory to search wider area (2)' '
|
test_expect_success 'grep from a subdirectory to search wider area (2)' '
|
||||||
mkdir -p s &&
|
mkdir -p s &&
|
||||||
(
|
(
|
||||||
cd s || exit 1
|
cd s &&
|
||||||
( git grep xxyyzz .. >out ; echo $? >status )
|
test_expect_code 1 git grep xxyyzz .. >out &&
|
||||||
! test -s out &&
|
! test -s out
|
||||||
test 1 = $(cat status)
|
|
||||||
)
|
)
|
||||||
'
|
'
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user