Browse files

test: am of empty patch should not succeed

The "git am empty" test uses the construct

	git am empty-file && false || :

which unconditionally returns true.  Use test_must_fail instead, which
also has the benefit of noticing if "git am" has segfaulted.

While at it, tighten the test to check that the diagnostic appears on
stderr and not stdout.

Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
  • Loading branch information...
1 parent b1f5b78 commit 948065a4837f006c5c84ee1288cf15f1a56d93f2 @jrn jrn committed with gitster Apr 13, 2012
Showing with 1 addition and 1 deletion.
  1. +1 −1 t/t4150-am.sh
View
2 t/t4150-am.sh
@@ -525,7 +525,7 @@ test_expect_success 'am empty-file does not infloop' '
git reset --hard &&
touch empty-file &&
test_tick &&
- { git am empty-file > actual 2>&1 && false || :; } &&
+ test_must_fail git am empty-file 2>actual &&
echo Patch format detection failed. >expected &&
test_i18ncmp expected actual
'

0 comments on commit 948065a

Please sign in to comment.