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>
Jeff King committed
Mar 7, 2009 at 12:14 UTC
003f69b282f9cc54da771e1b3e9378aa3f5178cd
1 file changed
+5
-5
t/t1300-repo-config.sh
+5
-5
@@ -336,10 +336,10 @@ test_expect_success 'get bool variable with empty value' \
336
'git config --bool emptyvalue.variable > output &&
337
cmp output expect'
338
339
-git config > output 2>&1
340
-
341
-test_expect_success 'no arguments, but no crash' \
342
- "test $? = 129 && grep usage output"
339
+test_expect_success 'no arguments, but no crash' '
340
+ test_must_fail git config >output 2>&1 &&
341
+ grep usage output
342
+'
343
344
cat > .git/config << EOF
345
[a.b]
@@ -373,7 +373,7 @@ EOF
373
test_expect_success 'new variable inserts into proper section' 'cmp .git/config expect'
374
375
test_expect_success 'alternative GIT_CONFIG (non-existing file should fail)' \
376
- 'git config --file non-existing-config -l; test $? != 0'
376
+ 'test_must_fail git config --file non-existing-config -l'
377
378
cat > other-config << EOF
379
[ein]