From eced93bcb8647ad7dad6511e0d58a4dad470f473 Mon Sep 17 00:00:00 2001 From: René Scharfe Date: Sat, 18 Nov 2017 19:04:00 +0100 Subject: t4051: add test for comments preceding function lines When showing function context it would be helpful to show comments immediately before declarations, as they are most likely relevant. Add a test for that, but without specifying the choice of lines too rigidly in the test---we may want to stop before and not include "/*" in the future, for example. Signed-off-by: Rene Scharfe Signed-off-by: Junio C Hamano --- t/t4051-diff-function-context.sh | 4 ++++ 1 file changed, 4 insertions(+) (limited to 't/t4051-diff-function-context.sh') diff --git a/t/t4051-diff-function-context.sh b/t/t4051-diff-function-context.sh index 3e6b485ecb..30fc5bf2b3 100755 --- a/t/t4051-diff-function-context.sh +++ b/t/t4051-diff-function-context.sh @@ -85,6 +85,10 @@ test_expect_success 'setup' ' check_diff changed_hello 'changed function' +test_expect_failure ' context includes comment' ' + grep "^ .*Hello comment" changed_hello.diff +' + test_expect_success ' context includes begin' ' grep "^ .*Begin of hello" changed_hello.diff ' -- cgit v1.3-5-g9baa