summaryrefslogtreecommitdiff
path: root/t
diff options
context:
space:
mode:
authorLibravatar Eric Sunshine <sunshine@sunshineco.com>2018-07-01 20:23:52 -0400
committerLibravatar Junio C Hamano <gitster@pobox.com>2018-07-16 14:38:47 -0700
commitd964def526b2256a1d573597e978774f1e584770 (patch)
tree4e03a2819e43fc56d9d7d18c12a1392d953ddaa1 /t
parentt7400: fix broken "submodule add/reconfigure --force" test (diff)
downloadtgif-d964def526b2256a1d573597e978774f1e584770.tar.xz
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>
Diffstat (limited to 't')
-rwxr-xr-xt/t7810-grep.sh7
1 files changed, 3 insertions, 4 deletions
diff --git a/t/t7810-grep.sh b/t/t7810-grep.sh
index 1797f632a3..fecee602c1 100755
--- a/t/t7810-grep.sh
+++ b/t/t7810-grep.sh
@@ -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)' '
mkdir -p s &&
(
- cd s || exit 1
- ( git grep xxyyzz .. >out ; echo $? >status )
- ! test -s out &&
- test 1 = $(cat status)
+ cd s &&
+ test_expect_code 1 git grep xxyyzz .. >out &&
+ ! test -s out
)
'