From: Eric Sunshine Date: Sun, 19 Nov 2017 01:18:17 GMT Subject: Re: [PATCH 1/6] t4051: add test for comments preceding function lines Message-ID: In-Reply-To: On Sat, Nov 18, 2017 at 1:04 PM, René Scharfe wrote: > 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. > > Signed-off-by: Rene Scharfe > --- > diff --git a/t/t4051-diff-function-context.sh b/t/t4051-diff-function-context.sh > @@ -85,6 +85,10 @@ test_expect_success 'setup' ' >> +test_expect_failure ' context includes comment' ' > + grep "^ .*Hello comment" changed_hello.diff > +' This shows only that the the "* Hello comment." line is in the context but says nothing about the entire comment block being included (which patch 3/6 implements). Perhaps the test could be more thorough? > diff --git a/t/t4051/hello.c b/t/t4051/hello.c > index 63b1a1e4ef..73e767e178 100644 > --- a/t/t4051/hello.c > +++ b/t/t4051/hello.c > @@ -1,4 +1,7 @@ > > +/* > + * Hello comment. > + */ > static void hello(void) // Begin of hello > {