From: Jonathan Nieder Date: Sat, 14 Apr 2012 04:48:13 +0000 (-0500) Subject: test: am of empty patch should not succeed X-Git-Tag: v1.7.11-rc0~121^2 X-Git-Url: https://git.lorimer.id.au/gitweb.git/diff_plain/948065a4837f006c5c84ee1288cf15f1a56d93f2?ds=inline;hp=--cc 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 Signed-off-by: Junio C Hamano --- 948065a4837f006c5c84ee1288cf15f1a56d93f2 diff --git a/t/t4150-am.sh b/t/t4150-am.sh index ebb4a26a0d..cdafd7e7c1 100755 --- a/t/t4150-am.sh +++ b/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 '