xref: /freebsd/bin/sh/tests/builtins/case2.0 (revision 02e9120893770924227138ba49df1edb3896112a)
1# Generated by ./test-fnmatch -s 1, do not edit.
2failures=
3failed() { printf '%s\n' "Failed: $1 '$2' '$3'"; failures=x$failures; }
4testmatch() { eval "case \$2 in ''$1) ;; *) failed testmatch \"\$@\";; esac"; }
5testnomatch() { eval "case \$2 in ''$1) failed testnomatch \"\$@\";; esac"; }
6testmatch '' ''
7testmatch 'a' 'a'
8testnomatch 'a' 'b'
9testnomatch 'a' 'A'
10testmatch '*' 'a'
11testmatch '*' 'aa'
12testmatch '*a' 'a'
13testnomatch '*a' 'b'
14testnomatch '*a*' 'b'
15testmatch '*a*b*' 'ab'
16testmatch '*a*b*' 'qaqbq'
17testmatch '*a*bb*' 'qaqbqbbq'
18testmatch '*a*bc*' 'qaqbqbcq'
19testmatch '*a*bb*' 'qaqbqbb'
20testmatch '*a*bc*' 'qaqbqbc'
21testmatch '*a*bb' 'qaqbqbb'
22testmatch '*a*bc' 'qaqbqbc'
23testnomatch '*a*bb' 'qaqbqbbq'
24testnomatch '*a*bc' 'qaqbqbcq'
25testnomatch '*a*a*a*a*a*a*a*a*a*a*' 'aaaaaaaaa'
26testmatch '*a*a*a*a*a*a*a*a*a*a*' 'aaaaaaaaaa'
27testmatch '*a*a*a*a*a*a*a*a*a*a*' 'aaaaaaaaaaa'
28testnomatch '.*.*.*.*.*.*.*.*.*.*' '.........'
29testmatch '.*.*.*.*.*.*.*.*.*.*' '..........'
30testmatch '.*.*.*.*.*.*.*.*.*.*' '...........'
31testnomatch '*?*?*?*?*?*?*?*?*?*?*' '123456789'
32testnomatch '??????????*' '123456789'
33testnomatch '*??????????' '123456789'
34testmatch '*?*?*?*?*?*?*?*?*?*?*' '1234567890'
35testmatch '??????????*' '1234567890'
36testmatch '*??????????' '1234567890'
37testmatch '*?*?*?*?*?*?*?*?*?*?*' '12345678901'
38testmatch '??????????*' '12345678901'
39testmatch '*??????????' '12345678901'
40testmatch '[x]' 'x'
41testmatch '[*]' '*'
42testmatch '[?]' '?'
43testmatch '[' '['
44testmatch '[[]' '['
45testnomatch '[[]' 'x'
46testnomatch '[*]' ''
47testnomatch '[*]' 'x'
48testnomatch '[?]' 'x'
49testmatch '*[*]*' 'foo*foo'
50testnomatch '*[*]*' 'foo'
51testmatch '[0-9]' '0'
52testmatch '[0-9]' '5'
53testmatch '[0-9]' '9'
54testnomatch '[0-9]' '/'
55testnomatch '[0-9]' ':'
56testnomatch '[0-9]' '*'
57testnomatch '[!0-9]' '0'
58testnomatch '[!0-9]' '5'
59testnomatch '[!0-9]' '9'
60testmatch '[!0-9]' '/'
61testmatch '[!0-9]' ':'
62testmatch '[!0-9]' '*'
63testmatch '*[0-9]' 'a0'
64testmatch '*[0-9]' 'a5'
65testmatch '*[0-9]' 'a9'
66testnomatch '*[0-9]' 'a/'
67testnomatch '*[0-9]' 'a:'
68testnomatch '*[0-9]' 'a*'
69testnomatch '*[!0-9]' 'a0'
70testnomatch '*[!0-9]' 'a5'
71testnomatch '*[!0-9]' 'a9'
72testmatch '*[!0-9]' 'a/'
73testmatch '*[!0-9]' 'a:'
74testmatch '*[!0-9]' 'a*'
75testmatch '*[0-9]' 'a00'
76testmatch '*[0-9]' 'a55'
77testmatch '*[0-9]' 'a99'
78testmatch '*[0-9]' 'a0a0'
79testmatch '*[0-9]' 'a5a5'
80testmatch '*[0-9]' 'a9a9'
81testmatch '\*' '*'
82testmatch '\?' '?'
83testmatch '\[x]' '[x]'
84testmatch '\[' '['
85testmatch '\\' '\'
86testmatch '*\**' 'foo*foo'
87testnomatch '*\**' 'foo'
88testmatch '*\\*' 'foo\foo'
89testnomatch '*\\*' 'foo'
90testmatch '\(' '('
91testmatch '\a' 'a'
92testnomatch '\*' 'a'
93testnomatch '\?' 'a'
94testnomatch '\*' '\*'
95testnomatch '\?' '\?'
96testnomatch '\[x]' '\[x]'
97testnomatch '\[x]' '\x'
98testnomatch '\[' '\['
99testnomatch '\(' '\('
100testnomatch '\a' '\a'
101testmatch '.*' '.'
102testmatch '.*' '..'
103testmatch '.*' '.a'
104testmatch 'a*' 'a.'
105[ -z "$failures" ]
106