t4051: rewrite, add more tests
commitd3621de789ab57739f48b065751089d828b50240
authorRené Scharfe <l.s.r@web.de>
Tue, 31 May 2016 20:00:38 +0000 (31 22:00 +0200)
committerJunio C Hamano <gitster@pobox.com>
Tue, 31 May 2016 20:07:58 +0000 (31 13:07 -0700)
tree639314d444cf9affe5ed340cca9a12d41de2a14d
parent90f7b16b3adc78d4bbabbd426fb69aa78c714f71
t4051: rewrite, add more tests

Remove the tests that checked against a fixed result and replace them
with more focused checks of desired properties of the created diffs.
That way we get more detailed and meaningful diagnostics.

Store test file contents in files in a subdirectory in order to avoid
cluttering the test script with them.

Use tagged commits to store the changes to test diff -W against instead
of using changes to the worktree.  Use the worktree instead to try and
apply the generated patch in order to validate it.

Document unwanted features: trailing empty lines, too much context for
appended functions, insufficient context at the end with -U0.

Helped-by: Junio C Hamano <gitster@pobox.com>
Signed-off-by: Rene Scharfe <l.s.r@web.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
t/t4051-diff-function-context.sh
t/t4051/appended1.c [new file with mode: 0644]
t/t4051/appended2.c [new file with mode: 0644]
t/t4051/dummy.c [new file with mode: 0644]
t/t4051/hello.c [new file with mode: 0644]
t/t4051/includes.c [new file with mode: 0644]