public inbox for git@vger.kernel.org 
 help / color / mirror / Atom feed
From: Junio C Hamano <gitster@pobox•com>
To: "Ævar Arnfjörð Bjarmason" <avarab@gmail•com>
Cc: git@vger•kernel.org
Subject: Re: [PATCH] wildmatch test: cover a blind spot in "/" matching
Date: Sat, 10 Jun 2017 10:55:32 +0900	[thread overview]
Message-ID: <xmqqlgp04ne3.fsf@gitster.mtv.corp.google.com> (raw)
In-Reply-To: <0102015c492e27c6-669f7ca8-e7c6-484f-9c5b-7cb9358ee966-000000@eu-west-1.amazonses.com> ("Ævar Arnfjörð Bjarmason"'s message of "Sat, 27 May 2017 09:13:00 +0000")

Ævar Arnfjörð Bjarmason  <avarab@gmail•com> writes:

> Add a test which covers a blindspot in how these tests should assert
> that negated character classes are allowed or not allowed to match "/"
> in certain circumstances.

Please make this a bit more explicit, something like

	A negated character class that does not include '/',
	e.g. [^a-z],

        - should match '/' when doing "wildmatch"
	- should not match '/' when doing "pathmatch"

	Add two tests to cover these cases.

Thanks.

> Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail•com>
> ---
>  t/t3070-wildmatch.sh | 2 ++
>  1 file changed, 2 insertions(+)
>
> diff --git a/t/t3070-wildmatch.sh b/t/t3070-wildmatch.sh
> index ef509df35160..65ea07b68356 100755
> --- a/t/t3070-wildmatch.sh
> +++ b/t/t3070-wildmatch.sh
> @@ -82,6 +82,7 @@ match 1 0 'foo/bar' 'foo/**/bar'
>  match 1 0 'foo/bar' 'foo/**/**/bar'
>  match 0 0 'foo/bar' 'foo?bar'
>  match 0 0 'foo/bar' 'foo[/]bar'
> +match 0 0 'foo/bar' 'foo[^a-z]bar'
>  match 0 0 'foo/bar' 'f[^eiu][^eiu][^eiu][^eiu][^eiu]r'
>  match 1 1 'foo-bar' 'f[^eiu][^eiu][^eiu][^eiu][^eiu]r'
>  match 1 0 'foo' '**/foo'
> @@ -226,6 +227,7 @@ pathmatch 0 foo/bba/arr 'foo/*z'
>  pathmatch 0 foo/bba/arr 'foo/**z'
>  pathmatch 1 foo/bar 'foo?bar'
>  pathmatch 1 foo/bar 'foo[/]bar'
> +pathmatch 1 foo/bar 'foo[^a-z]bar'
>  pathmatch 0 foo '*/*/*'
>  pathmatch 0 foo/bar '*/*/*'
>  pathmatch 1 foo/bba/arr '*/*/*'
>
> --
> https://github.com/git/git/pull/362

  parent reply	other threads:[~2017-06-10  1:55 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-05-27  9:13 [PATCH] wildmatch test: cover a blind spot in "/" matching Ævar Arnfjörð Bjarmason
2017-06-09 16:21 ` Ævar Arnfjörð Bjarmason
2017-06-10  1:55 ` Junio C Hamano [this message]
2017-06-10  1:57   ` Junio C Hamano
2017-06-10 11:31     ` Ævar Arnfjörð Bjarmason

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=xmqqlgp04ne3.fsf@gitster.mtv.corp.google.com \
    --to=gitster@pobox$(echo .)com \
    --cc=avarab@gmail$(echo .)com \
    --cc=git@vger$(echo .)kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox