Re: [PATCH 07/20] userdiff tests: match full hunk headers
- From
Eric Sunshine <sunshine@sunshineco.com>
- Date
- Feb 15, 2021, 01:35 UTC
- Message-ID
- <CAPig+cSo-a12aUo-Xwo=7nECpXTsWv+nsoh6DnfUQGk4TZeqyw@mail.gmail.com>
- In-Reply-To
- <20210215005236.11313-8-avarab@gmail.com>
On Sun, Feb 14, 2021 at 7:56 PM Ævar Arnfjörð Bjarmason <avarab@gmail.com> wrote:
Show 18 quoted lines
> [...] > Let's bring back coverage for that by adding corresponding *.ctx > files, this has the added advantage that we're doing a "test_cmp", so > when we have failures it's just a non-zero exit code from "grep", > we'll actually have something meaningful in the "-v" output. > [...] > Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com> > --- > diff --git a/t/t4018-diff-funcname.sh b/t/t4018-diff-funcname.sh > @@ -81,11 +81,12 @@ test_expect_success 'setup hunk header tests' ' > +for i in $(git ls-files -- ':!*.ctx') > do > test_expect_success "hunk header: $i" " > + git diff -U1 $i >diff && > + sed -n -e 's/^.*@@\( \|$\)//p' <diff >ctx && > + test_cmp $i.ctx ctx > " > done
If I'm reading this correctly, you're simply stripping off all the leading `@@ blah @@` stuff...
Show 7 quoted lines
> diff --git a/t/t4018/README b/t/t4018/README > @@ -1,15 +1,15 @@ > +The text that must appear in the hunk header must contains the word > +"RIGHT" by convention. The "LANG-whatever.ctx" file contains what we > +expect to appear in the hunk header. We munged the start of the line > +to "@@ [...] @@" for ease of not having to hardcode the line numbers > +and offsets.
...which makes me wonder what this "munging to `@@ [...] @@`" is about.
Is this documentation update wrong or am I misunderstanding?