t: use test_expect_code instead of hand-rolled comparison

This makes our output in the event of a failure slightly
nicer, and it means that we do not break the &&-chain.

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:
Jeff King
2015-03-20 06:11:46 -04:00
committed by Junio C Hamano
parent 35da1bf5d6
commit c21fc9d0ab
3 changed files with 38 additions and 44 deletions

View File

@ -17,8 +17,8 @@ test_expect_success 'setup' '
'
test_expect_success 'git diff --no-index directories' '
git diff --no-index a b >cnt
test $? = 1 && test_line_count = 14 cnt
test_expect_code 1 git diff --no-index a b >cnt &&
test_line_count = 14 cnt
'
test_expect_success 'git diff --no-index relative path outside repo' '