path: root/t/t4051/hello.c
diff options
authorRené Scharfe <>2016-05-31 20:00:38 (GMT)
committerJunio C Hamano <>2016-05-31 20:07:58 (GMT)
commitd3621de789ab57739f48b065751089d828b50240 (patch)
tree639314d444cf9affe5ed340cca9a12d41de2a14d /t/t4051/hello.c
parent90f7b16b3adc78d4bbabbd426fb69aa78c714f71 (diff)
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 <> Signed-off-by: Rene Scharfe <> Signed-off-by: Junio C Hamano <>
Diffstat (limited to 't/t4051/hello.c')
1 files changed, 21 insertions, 0 deletions
diff --git a/t/t4051/hello.c b/t/t4051/hello.c
new file mode 100644
index 0000000..63b1a1e
--- /dev/null
+++ b/t/t4051/hello.c
@@ -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