@@ -6,20 +6,20 @@ test_description='wildmatch tests'
6
6
7
7
match () {
8
8
if [ $1 = 1 ]; then
9
- test_expect_success " wildmatch: match '$3 ' '$4 '" "
9
+ test_expect_success " wildmatch: match '$3 ' '$4 '" "
10
10
test-wildmatch wildmatch '$3 ' '$4 '
11
11
"
12
12
else
13
- test_expect_success " wildmatch: no match '$3 ' '$4 '" "
13
+ test_expect_success " wildmatch: no match '$3 ' '$4 '" "
14
14
! test-wildmatch wildmatch '$3 ' '$4 '
15
15
"
16
16
fi
17
17
if [ $2 = 1 ]; then
18
- test_expect_success " fnmatch: match '$3 ' '$4 '" "
18
+ test_expect_success " fnmatch: match '$3 ' '$4 '" "
19
19
test-wildmatch fnmatch '$3 ' '$4 '
20
20
"
21
21
elif [ $2 = 0 ]; then
22
- test_expect_success " fnmatch: no match '$3 ' '$4 '" "
22
+ test_expect_success " fnmatch: no match '$3 ' '$4 '" "
23
23
! test-wildmatch fnmatch '$3 ' '$4 '
24
24
"
25
25
# else
@@ -29,13 +29,25 @@ match() {
29
29
fi
30
30
}
31
31
32
+ imatch () {
33
+ if [ $1 = 1 ]; then
34
+ test_expect_success " iwildmatch: match '$2 ' '$3 '" "
35
+ test-wildmatch iwildmatch '$2 ' '$3 '
36
+ "
37
+ else
38
+ test_expect_success " iwildmatch: no match '$2 ' '$3 '" "
39
+ ! test-wildmatch iwildmatch '$2 ' '$3 '
40
+ "
41
+ fi
42
+ }
43
+
32
44
pathmatch () {
33
45
if [ $1 = 1 ]; then
34
- test_expect_success " pathmatch: match '$2 ' '$3 '" "
46
+ test_expect_success " pathmatch: match '$2 ' '$3 '" "
35
47
test-wildmatch pathmatch '$2 ' '$3 '
36
48
"
37
49
else
38
- test_expect_success " pathmatch: no match '$2 ' '$3 '" "
50
+ test_expect_success " pathmatch: no match '$2 ' '$3 '" "
39
51
! test-wildmatch pathmatch '$2 ' '$3 '
40
52
"
41
53
fi
@@ -235,4 +247,35 @@ pathmatch 1 abcXdefXghi '*X*i'
235
247
pathmatch 1 ab/cXd/efXg/hi ' */*X*/*/*i'
236
248
pathmatch 1 ab/cXd/efXg/hi ' *Xg*i'
237
249
250
+ # Case-sensitivy features
251
+ match 0 x ' a' ' [A-Z]'
252
+ match 1 x ' A' ' [A-Z]'
253
+ match 0 x ' A' ' [a-z]'
254
+ match 1 x ' a' ' [a-z]'
255
+ match 0 x ' a' ' [[:upper:]]'
256
+ match 1 x ' A' ' [[:upper:]]'
257
+ match 0 x ' A' ' [[:lower:]]'
258
+ match 1 x ' a' ' [[:lower:]]'
259
+ match 0 x ' A' ' [B-Za]'
260
+ match 1 x ' a' ' [B-Za]'
261
+ match 0 x ' A' ' [B-a]'
262
+ match 1 x ' a' ' [B-a]'
263
+ match 0 x ' z' ' [Z-y]'
264
+ match 1 x ' Z' ' [Z-y]'
265
+
266
+ imatch 1 ' a' ' [A-Z]'
267
+ imatch 1 ' A' ' [A-Z]'
268
+ imatch 1 ' A' ' [a-z]'
269
+ imatch 1 ' a' ' [a-z]'
270
+ imatch 1 ' a' ' [[:upper:]]'
271
+ imatch 1 ' A' ' [[:upper:]]'
272
+ imatch 1 ' A' ' [[:lower:]]'
273
+ imatch 1 ' a' ' [[:lower:]]'
274
+ imatch 1 ' A' ' [B-Za]'
275
+ imatch 1 ' a' ' [B-Za]'
276
+ imatch 1 ' A' ' [B-a]'
277
+ imatch 1 ' a' ' [B-a]'
278
+ imatch 1 ' z' ' [Z-y]'
279
+ imatch 1 ' Z' ' [Z-y]'
280
+
238
281
test_done
0 commit comments