3 test_description='diff function context'
6 . "$TEST_DIRECTORY"/diff-lib.sh
19 static int hello_world(void)
22 printf("Hello world.\n");
34 int main(int argc, char **argv)
42 test_expect_success 'setup' '
45 git commit -m initial &&
47 grep -v Classic <hello.c >hello.c.new &&
48 mv hello.c.new hello.c
52 diff --git a/hello.c b/hello.c
55 @@ -10,8 +10,7 @@ static int a(void)
56 static int hello_world(void)
59 printf("Hello world.\n");
66 test_expect_success 'diff -U0 -W' '
67 git diff -U0 -W >actual &&
68 compare_diff_patch actual expected
72 diff --git a/hello.c b/hello.c
75 @@ -9,9 +9,8 @@ static int a(void)
77 static int hello_world(void)
80 printf("Hello world.\n");
87 test_expect_success 'diff -W' '
88 git diff -W >actual &&
89 compare_diff_patch actual expected