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 <l.s.r@web.de> Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:
parent
89ea799ffc
commit
eced93bcb8
@ -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
|
||||
'
|
||||
|
@ -1,4 +1,7 @@
|
||||
|
||||
/*
|
||||
* Hello comment.
|
||||
*/
|
||||
static void hello(void) // Begin of hello
|
||||
{
|
||||
/*
|
||||
|
Loading…
Reference in New Issue
Block a user