Re: [PATCH 07/20] userdiff tests: match full hunk headers

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Sun, Feb 14, 2021 at 7:56 PM Ævar Arnfjörð Bjarmason
<avarab@xxxxxxxxx> wrote:
> [...]
> 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@xxxxxxxxx>
> ---
> 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...

> 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?



[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]

  Powered by Linux