]> git.proxmox.com Git - rustc.git/blame - vendor/gix-glob/tests/fixtures/make_baseline.sh
New upstream version 1.74.1+dfsg1
[rustc.git] / vendor / gix-glob / tests / fixtures / make_baseline.sh
CommitLineData
0a29b90c
FG
1#!/bin/bash
2set -eu -o pipefail
3
4git init -q
5git config core.autocrlf false
6git config core.ignorecase false
7
8while read -r pattern value; do
9 echo "$pattern" "$value"
10 echo "$pattern" > .gitignore
11 echo "$value" | git check-ignore -vn --stdin 2>&1 || :
12done <<EOF >git-baseline.nmatch
13/*foo bam/barfoo/baz/bam
14/*foo bar/bam/barfoo/baz/bam
15foo foobaz
16*/\' XXX/\'
17/*foo bar/foo
18/*foo bar/bazfoo
19foo*bar foo/baz/bar
20/*foo.txt hello/foo.txt
21bar/foo baz/bar/foo
22*hello.txt hello.txt-and-then-some
23*hello.txt goodbye.txt
24*some/path/to/hello.txt some/path/to/hello.txt-and-then-some
25*some/path/to/hello.txt some/other/path/to/hello.txt
26*some/path/to/hello.txt a/bigger/some/path/to/hello.txt
27abc?def abc/def
28a*b*c abcd
29abc*abc*abc abcabcabcabcabcabcabca
30a[0-9]b a_b
31a[!0-9]b a0b
32a[!0-9]b a9b
33[!-] -
34a[^0-9]b a0b
35a[^0-9]b a9b
36[^-] -
37{a,b} a
38{a,b} b
39{[}],foo} }
40{foo} foo
41{*.foo,*.bar,*.wat} test.foo
42{*.foo,*.bar,*.wat} test.bar
43{*.foo,*.bar,*.wat} test.wat
44abc*def abc/def
45aBcDeFg abcdefg
46aBcDeFg ABCDEFG
47aBcDeFg AbCdEfG
48some/**/needle.txt some/other/notthis.txt
49some/**/**/needle.txt some/other/notthis.txt
50/**/test one/notthis
51/**/test notthis
52**/.* ab.c
53**/.* abc/ab.c
54.*/** a.bc
55.*/** abc/a.bc
56./foo foo
57**/foo foofoo
58**/foo/bar foofoo/bar
59/*.c mozilla-sha1/sha1.c
60**/m4/ltoptions.m4 csharp/src/packages/repositories.config
61some/*/needle.txt some/needle.txt
62some/*/needle.txt some/one/two/needle.txt
63some/*/needle.txt some/one/two/three/needle.txt
64.*/** .abc
65foo/** foo
66{**/src/**,foo} abc/src/bar
67{**/src/**,foo} foo
68abc[/]def abc/def
69EOF
70
71while read -r pattern value; do
72 echo "$pattern" "$value"
73 echo "$pattern" > .gitignore
74 echo "$value" | git check-ignore -vn --stdin 2>&1 || :
75done <<EOF >git-baseline.match
76*/' XXX/'
77\a a
78\\\[a-z] \a
79\\\? \a
80\\\* \\
81/*foo.txt barfoo.txt
82*foo.txt bar/foo.txt
83*.c mozilla-sha1/sha1.c
84*.rs .rs
85*hello.txt hello.txt
86*hello.txt gareth_says_hello.txt
87*hello.txt some/path/to/hello.txt
88/*foo.txt foo.txt
89*hello.txt some\path\to\hello.txt
90*hello.txt an/absolute/path/to/hello.txt
91*some/path/to/hello.txt some/path/to/hello.txt
92a foo/a
93a a
94a*b a_b
95a*b*c abc
96a*b*c a_b_c
97a*b*c a___b___c
98abc*abc*abc abcabcabcabcabcabcabc
99a*a*a*a*a*a*a*a*a aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
100a*b[xyz]c*d abxcdbxcddd
101☃ ☃
102** abcde
103** .asdf
104** x/.asdf
105a[0-9]b a0b
106a[0-9]b a9b
107a[!0-9]b a_b
108[a-z123] 1
109[1a-z23] 1
110[123a-z] 1
111[abc-] -
112[-abc] -
113[-a-c] b
114[a-c-] b
115[-] -
116a[^0-9]b a_b
117_[[]_[]]_[?]_[*]_!_ _[_]_?_*_!_
118a,b a,b
119\[ [
120\? ?
121\* *
122aBcDeFg aBcDeFg
123some/**/needle.txt some/needle.txt
124some/**/needle.txt some/one/needle.txt
125some/**/needle.txt some/one/two/needle.txt
126some/**/needle.txt some/other/needle.txt
127some/**/**/needle.txt some/needle.txt
128some/**/**/needle.txt some/one/needle.txt
129some/**/**/needle.txt some/one/two/needle.txt
130some/**/**/needle.txt some/other/needle.txt
131**/test one/two/test
132**/test one/test
133**/test test
134/**/test one/two/test
135/**/test one/test
136/**/test test
137**/.* .abc
138**/.* abc/.abc
139**/foo/bar foo/bar
140.*/** .abc/abc
141test/** test/
142test/** test/one
143test/** test/one/two
144some/*/needle.txt some/one/needle.txt
145abc/def abc/def
146EOF
147
148git config core.ignorecase true
149while read -r pattern value; do
150 echo "$pattern" "$value"
151 echo "$pattern" > .gitignore
152 echo "$value" | git check-ignore -vn --stdin 2>&1 || :
153done <<EOF >git-baseline.match-icase
154aBcDeFg aBcDeFg
155aBcDeFg abcdefg
156aBcDeFg ABCDEFG
157aBcDeFg AbCdEfG
158EOF