t1300: use test_must_fail as appropriate

Some of the tests checked the exit code manually, even going
so far as to run git outside of the test_expect harness.

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
maint
Jeff King 2009-03-07 12:14:04 -05:00 committed by Junio C Hamano
parent c2e9364a06
commit 003f69b282
1 changed files with 5 additions and 5 deletions

View File

@ -336,10 +336,10 @@ test_expect_success 'get bool variable with empty value' \
'git config --bool emptyvalue.variable > output && 'git config --bool emptyvalue.variable > output &&
cmp output expect' cmp output expect'


git config > output 2>&1 test_expect_success 'no arguments, but no crash' '

test_must_fail git config >output 2>&1 &&
test_expect_success 'no arguments, but no crash' \ grep usage output
"test $? = 129 && grep usage output" '


cat > .git/config << EOF cat > .git/config << EOF
[a.b] [a.b]
@ -373,7 +373,7 @@ EOF
test_expect_success 'new variable inserts into proper section' 'cmp .git/config expect' test_expect_success 'new variable inserts into proper section' 'cmp .git/config expect'


test_expect_success 'alternative GIT_CONFIG (non-existing file should fail)' \ test_expect_success 'alternative GIT_CONFIG (non-existing file should fail)' \
'git config --file non-existing-config -l; test $? != 0' 'test_must_fail git config --file non-existing-config -l'


cat > other-config << EOF cat > other-config << EOF
[ein] [ein]