t5303: use printf to generate delta bases
[gitweb.git] / t / t4051-diff-function-context.sh
index 6154acb4569eb452f4e19a40ba40e19703ecca88..4838a1df8b4369dc5024cdd7929d851b76482805 100755 (executable)
@@ -72,7 +72,8 @@ test_expect_success 'setup' '
 
        # overlap function context of 1st change and -u context of 2nd change
        grep -v "delete me from hello" <"$dir/hello.c" >file.c &&
-       sed 2p <"$dir/dummy.c" >>file.c &&
+       sed "2a\\
+            extra line" <"$dir/dummy.c" >>file.c &&
        commit_and_tag changed_hello_dummy file.c &&
 
        git checkout initial &&
@@ -84,6 +85,10 @@ test_expect_success 'setup' '
 
 check_diff changed_hello 'changed function'
 
+test_expect_success ' context includes comment' '
+       grep "^ .*Hello comment" changed_hello.diff
+'
+
 test_expect_success ' context includes begin' '
        grep "^ .*Begin of hello" changed_hello.diff
 '
@@ -169,7 +174,7 @@ test_expect_success ' context does not include other functions' '
 '
 
 test_expect_success ' context does not include preceding empty lines' '
-       test "$(first_context_line <long_common_tail.diff.diff)" != " "
+       test "$(first_context_line <long_common_tail.diff)" != " "
 '
 
 check_diff changed_hello_appended 'changed function plus appended function'