Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
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>
- Loading branch information
Showing
6 changed files
with
240 additions
and
74 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
|
||
int appended(void) // Begin of first part | ||
{ | ||
int i; | ||
char *s = "a string"; | ||
|
||
printf("%s\n", s); | ||
|
||
for (i = 99; | ||
i >= 0; | ||
i--) { | ||
printf("%d bottles of beer on the wall\n", i); | ||
} | ||
|
||
printf("End of first part\n"); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
printf("Begin of second part\n"); | ||
|
||
/* | ||
* Lorem ipsum dolor sit amet, consectetuer sadipscing elitr, | ||
* sed diam nonumy eirmod tempor invidunt ut labore et dolore | ||
* magna aliquyam erat, sed diam voluptua. At vero eos et | ||
* accusam et justo duo dolores et ea rebum. Stet clita kasd | ||
* gubergren, no sea takimata sanctus est Lorem ipsum dolor | ||
* sit amet. | ||
* | ||
* Lorem ipsum dolor sit amet, consectetuer sadipscing elitr, | ||
* sed diam nonumy eirmod tempor invidunt ut labore et dolore | ||
* magna aliquyam erat, sed diam voluptua. At vero eos et | ||
* accusam et justo duo dolores et ea rebum. Stet clita kasd | ||
* gubergren, no sea takimata sanctus est Lorem ipsum dolor | ||
* sit amet. | ||
* | ||
* Lorem ipsum dolor sit amet, consectetuer sadipscing elitr, | ||
* sed diam nonumy eirmod tempor invidunt ut labore et dolore | ||
* magna aliquyam erat, sed diam voluptua. At vero eos et | ||
* accusam et justo duo dolores et ea rebum. Stet clita kasd | ||
* gubergren, no sea takimata sanctus est Lorem ipsum dolor | ||
* sit amet. | ||
* | ||
* Lorem ipsum dolor sit amet, consectetuer sadipscing elitr, | ||
* sed diam nonumy eirmod tempor invidunt ut labore et dolore | ||
* magna aliquyam erat, sed diam voluptua. At vero eos et | ||
* accusam et justo duo dolores et ea rebum. Stet clita kasd | ||
* gubergren, no sea takimata sanctus est Lorem ipsum dolor | ||
* sit amet. | ||
* | ||
*/ | ||
|
||
return 0; | ||
} // End of second part |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
|
||
static int dummy(void) // Begin of dummy | ||
{ | ||
int rc = 0; | ||
|
||
return rc; | ||
} // End of dummy |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
|
||
static void hello(void) // Begin of hello | ||
{ | ||
/* | ||
* Classic. | ||
*/ | ||
putchar('H'); | ||
putchar('e'); | ||
putchar('l'); | ||
putchar('l'); | ||
putchar('o'); | ||
putchar(' '); | ||
/* delete me from hello */ | ||
putchar('w'); | ||
putchar('o'); | ||
putchar('r'); | ||
putchar('l'); | ||
putchar('d'); | ||
putchar('.'); | ||
putchar('\n'); | ||
} // End of hello |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
#include <Begin.h> | ||
#include <unistd.h> | ||
#include <stdio.h> | ||
#include <sys/stat.h> | ||
#include <fcntl.h> | ||
#include <stddef.h> | ||
#include <stdlib.h> | ||
#include <stdarg.h> | ||
/* delete me from includes */ | ||
#include <string.h> | ||
#include <sys/types.h> | ||
#include <dirent.h> | ||
#include <sys/time.h> | ||
#include <time.h> | ||
#include <signal.h> | ||
#include <assert.h> | ||
#include <regex.h> | ||
#include <utime.h> | ||
#include <syslog.h> | ||
#include <End.h> |