* [PATCH v2] wildmatch test: cover a blind spot in "/" matching
[not found] <CAPc5daWy3eq-ODwDSbvhvRPH87QR0WMttZQUhmKfcZxs4qvdaQ@mail.gmail.com>
@ 2017-06-15 21:10 ` Ævar Arnfjörð Bjarmason
2017-06-15 22:01 ` Junio C Hamano
0 siblings, 1 reply; 2+ messages in thread
From: Ævar Arnfjörð Bjarmason @ 2017-06-15 21:10 UTC (permalink / raw)
To: git; +Cc: Junio C Hamano, Ævar Arnfjörð Bjarmason
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.
Helped-by: Junio C Hamano <gitster@pobox.com>
Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
---
Now with updated commit message, no other changes. Sorry about the
delay.
t/t3070-wildmatch.sh | 2 ++
1 file changed, 2 insertions(+)
diff --git a/t/t3070-wildmatch.sh b/t/t3070-wildmatch.sh
index 7ca69f4bed..8fd70d3aa2 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'
@@ -225,6 +226,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 '*/*/*'
--
2.13.1.508.gb3defc5cc
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH v2] wildmatch test: cover a blind spot in "/" matching
2017-06-15 21:10 ` [PATCH v2] wildmatch test: cover a blind spot in "/" matching Ævar Arnfjörð Bjarmason
@ 2017-06-15 22:01 ` Junio C Hamano
0 siblings, 0 replies; 2+ messages in thread
From: Junio C Hamano @ 2017-06-15 22:01 UTC (permalink / raw)
To: Ævar Arnfjörð Bjarmason; +Cc: git
Ævar Arnfjörð Bjarmason <avarab@gmail.com> writes:
> 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.
>
> Helped-by: Junio C Hamano <gitster@pobox.com>
> Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
> ---
>
> Now with updated commit message, no other changes. Sorry about the
> delay.
Thanks. I completely forgot about this topic ;-)
>
> t/t3070-wildmatch.sh | 2 ++
> 1 file changed, 2 insertions(+)
>
> diff --git a/t/t3070-wildmatch.sh b/t/t3070-wildmatch.sh
> index 7ca69f4bed..8fd70d3aa2 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'
> @@ -225,6 +226,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 '*/*/*'
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2017-06-15 22:01 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
[not found] <CAPc5daWy3eq-ODwDSbvhvRPH87QR0WMttZQUhmKfcZxs4qvdaQ@mail.gmail.com>
2017-06-15 21:10 ` [PATCH v2] wildmatch test: cover a blind spot in "/" matching Ævar Arnfjörð Bjarmason
2017-06-15 22:01 ` Junio C Hamano
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).