summary refs log tree commit diff
path: root/bin/cash/tests/builtins/case3.0
blob: 4eb688fefcf835203a00e08559a63499a4094b11 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
# Generated by ./test-fnmatch -s 2, do not edit.
# $FreeBSD: releng/12.0/bin/sh/tests/builtins/case3.0 207821 2010-05-09 16:15:40Z jilles $
failures=
failed() { printf '%s\n' "Failed: $1 '$2' '$3'"; failures=x$failures; }
# We do not treat a backslash specially in this case,
# but this is not the case in all shells.
netestmatch() { case $2 in $1) ;; *) failed netestmatch "$@";; esac; }
netestnomatch() { case $2 in $1) failed netestnomatch "$@";; esac; }
netestmatch '' ''
netestmatch 'a' 'a'
netestnomatch 'a' 'b'
netestnomatch 'a' 'A'
netestmatch '*' 'a'
netestmatch '*' 'aa'
netestmatch '*a' 'a'
netestnomatch '*a' 'b'
netestnomatch '*a*' 'b'
netestmatch '*a*b*' 'ab'
netestmatch '*a*b*' 'qaqbq'
netestmatch '*a*bb*' 'qaqbqbbq'
netestmatch '*a*bc*' 'qaqbqbcq'
netestmatch '*a*bb*' 'qaqbqbb'
netestmatch '*a*bc*' 'qaqbqbc'
netestmatch '*a*bb' 'qaqbqbb'
netestmatch '*a*bc' 'qaqbqbc'
netestnomatch '*a*bb' 'qaqbqbbq'
netestnomatch '*a*bc' 'qaqbqbcq'
netestnomatch '*a*a*a*a*a*a*a*a*a*a*' 'aaaaaaaaa'
netestmatch '*a*a*a*a*a*a*a*a*a*a*' 'aaaaaaaaaa'
netestmatch '*a*a*a*a*a*a*a*a*a*a*' 'aaaaaaaaaaa'
netestnomatch '.*.*.*.*.*.*.*.*.*.*' '.........'
netestmatch '.*.*.*.*.*.*.*.*.*.*' '..........'
netestmatch '.*.*.*.*.*.*.*.*.*.*' '...........'
netestnomatch '*?*?*?*?*?*?*?*?*?*?*' '123456789'
netestnomatch '??????????*' '123456789'
netestnomatch '*??????????' '123456789'
netestmatch '*?*?*?*?*?*?*?*?*?*?*' '1234567890'
netestmatch '??????????*' '1234567890'
netestmatch '*??????????' '1234567890'
netestmatch '*?*?*?*?*?*?*?*?*?*?*' '12345678901'
netestmatch '??????????*' '12345678901'
netestmatch '*??????????' '12345678901'
netestmatch '[x]' 'x'
netestmatch '[*]' '*'
netestmatch '[?]' '?'
netestmatch '[' '['
netestmatch '[[]' '['
netestnomatch '[[]' 'x'
netestnomatch '[*]' ''
netestnomatch '[*]' 'x'
netestnomatch '[?]' 'x'
netestmatch '*[*]*' 'foo*foo'
netestnomatch '*[*]*' 'foo'
netestmatch '[0-9]' '0'
netestmatch '[0-9]' '5'
netestmatch '[0-9]' '9'
netestnomatch '[0-9]' '/'
netestnomatch '[0-9]' ':'
netestnomatch '[0-9]' '*'
netestnomatch '[!0-9]' '0'
netestnomatch '[!0-9]' '5'
netestnomatch '[!0-9]' '9'
netestmatch '[!0-9]' '/'
netestmatch '[!0-9]' ':'
netestmatch '[!0-9]' '*'
netestmatch '*[0-9]' 'a0'
netestmatch '*[0-9]' 'a5'
netestmatch '*[0-9]' 'a9'
netestnomatch '*[0-9]' 'a/'
netestnomatch '*[0-9]' 'a:'
netestnomatch '*[0-9]' 'a*'
netestnomatch '*[!0-9]' 'a0'
netestnomatch '*[!0-9]' 'a5'
netestnomatch '*[!0-9]' 'a9'
netestmatch '*[!0-9]' 'a/'
netestmatch '*[!0-9]' 'a:'
netestmatch '*[!0-9]' 'a*'
netestmatch '*[0-9]' 'a00'
netestmatch '*[0-9]' 'a55'
netestmatch '*[0-9]' 'a99'
netestmatch '*[0-9]' 'a0a0'
netestmatch '*[0-9]' 'a5a5'
netestmatch '*[0-9]' 'a9a9'
netestmatch '\*' '\*'
netestmatch '\?' '\?'
netestmatch '\' '\'
netestnomatch '\\' '\'
netestmatch '\\' '\\'
netestmatch '*\*' 'foo\foo'
netestnomatch '*\*' 'foo'
netestmatch '.*' '.'
netestmatch '.*' '..'
netestmatch '.*' '.a'
netestmatch 'a*' 'a.'
[ -z "$failures" ]