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>
This commit is contained in:
Jonathan Nieder 2012-04-13 23:48:13 -05:00 committed by Junio C Hamano
parent b1f5b7839c
commit 948065a483

View File

@ -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
'