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>
Eric Sunshine committed
Jul 1, 2018 at 20:23 UTC
d964def526b2256a1d573597e978774f1e584770
1 file changed
+3
-4
t/t7810-grep.sh
+3
-4
@@ -845,10 +845,9 @@ test_expect_success 'grep from a subdirectory to search wider area (1)' '
845
test_expect_success 'grep from a subdirectory to search wider area (2)' '
846
mkdir -p s &&
847
(
848
- cd s || exit 1
849
- ( git grep xxyyzz .. >out ; echo $? >status )
850
- ! test -s out &&
851
- test 1 = $(cat status)
848
+ cd s &&
849
+ test_expect_code 1 git grep xxyyzz .. >out &&
850
+ ! test -s out
851
)
852
'
853