(t *testing.T)
| 8 | ) |
| 9 | |
| 10 | func TestMatchPattern(t *testing.T) { |
| 11 | kases := []struct { |
| 12 | inputs []string |
| 13 | patterns []string |
| 14 | skipResult bool |
| 15 | filterResult bool |
| 16 | }{ |
| 17 | { |
| 18 | patterns: []string{"*"}, |
| 19 | inputs: []string{"path/with/slash"}, |
| 20 | skipResult: true, |
| 21 | filterResult: false, |
| 22 | }, |
| 23 | { |
| 24 | patterns: []string{"path/a", "path/b", "path/c"}, |
| 25 | inputs: []string{"meta", "path/b", "otherfile"}, |
| 26 | skipResult: false, |
| 27 | filterResult: false, |
| 28 | }, |
| 29 | { |
| 30 | patterns: []string{"path/a", "path/b", "path/c"}, |
| 31 | inputs: []string{"path/b"}, |
| 32 | skipResult: false, |
| 33 | filterResult: true, |
| 34 | }, |
| 35 | { |
| 36 | patterns: []string{"path/a", "path/b", "path/c"}, |
| 37 | inputs: []string{"path/c", "path/b"}, |
| 38 | skipResult: false, |
| 39 | filterResult: true, |
| 40 | }, |
| 41 | { |
| 42 | patterns: []string{"path/a", "path/b", "path/c"}, |
| 43 | inputs: []string{"path/c", "path/b", "path/a"}, |
| 44 | skipResult: false, |
| 45 | filterResult: true, |
| 46 | }, |
| 47 | { |
| 48 | patterns: []string{"path/a", "path/b", "path/c"}, |
| 49 | inputs: []string{"path/c", "path/b", "path/d", "path/a"}, |
| 50 | skipResult: false, |
| 51 | filterResult: false, |
| 52 | }, |
| 53 | { |
| 54 | patterns: []string{}, |
| 55 | inputs: []string{}, |
| 56 | skipResult: false, |
| 57 | filterResult: false, |
| 58 | }, |
| 59 | { |
| 60 | patterns: []string{"\\!file"}, |
| 61 | inputs: []string{"!file"}, |
| 62 | skipResult: false, |
| 63 | filterResult: true, |
| 64 | }, |
| 65 | { |
| 66 | patterns: []string{"escape\\\\backslash"}, |
| 67 | inputs: []string{"escape\\backslash"}, |
nothing calls this directly
no test coverage detected
searching dependent graphs…