Browse Source

t4254: merge 2 steps of a single test

While we are at it, make sure we run a clean up after testing.
In a later patch, we will test for more corrupted patch.

Signed-off-by: Đoàn Trần Công Danh <congdanhqx@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
maint
Đoàn Trần Công Danh 5 years ago committed by Junio C Hamano
parent
commit
2ed282cc0d
  1. 6
      t/t4254-am-corrupt.sh

6
t/t4254-am-corrupt.sh

@ -25,10 +25,8 @@ test_expect_success setup ' @@ -25,10 +25,8 @@ test_expect_success setup '
# fatal: unable to write file '(null)' mode 100644: Bad address
# Also, it had the unwanted side-effect of deleting f.
test_expect_success 'try to apply corrupted patch' '
test_must_fail git -c advice.amWorkDir=false am bad-patch.diff 2>actual
'

test_expect_success 'compare diagnostic; ensure file is still here' '
test_when_finished "git am --abort" &&
test_must_fail git -c advice.amWorkDir=false am bad-patch.diff 2>actual &&
echo "error: git diff header lacks filename information (line 4)" >expected &&
test_path_is_file f &&
test_i18ncmp expected actual

Loading…
Cancel
Save