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:

committed by
Junio C Hamano

parent
35da1bf5d6
commit
c21fc9d0ab
@ -172,12 +172,9 @@ test_expect_success 'long options' '
|
||||
'
|
||||
|
||||
test_expect_success 'missing required value' '
|
||||
test-parse-options -s;
|
||||
test $? = 129 &&
|
||||
test-parse-options --string;
|
||||
test $? = 129 &&
|
||||
test-parse-options --file;
|
||||
test $? = 129
|
||||
test_expect_code 129 test-parse-options -s &&
|
||||
test_expect_code 129 test-parse-options --string &&
|
||||
test_expect_code 129 test-parse-options --file
|
||||
'
|
||||
|
||||
cat > expect << EOF
|
||||
@ -227,8 +224,7 @@ test_expect_success 'unambiguously abbreviated option with "="' '
|
||||
'
|
||||
|
||||
test_expect_success 'ambiguously abbreviated option' '
|
||||
test-parse-options --strin 123;
|
||||
test $? = 129
|
||||
test_expect_code 129 test-parse-options --strin 123
|
||||
'
|
||||
|
||||
cat > expect << EOF
|
||||
|
Reference in New Issue
Block a user