plumbing/format/gitignore/matcher_test.go
raw| 1 | package gitignore |
| 2 | |
| 3 | import ( |
| 4 | . "gopkg.in/check.v1" |
| 5 | ) |
| 6 | |
| 7 | func (s *MatcherSuite) TestMatcher_Match(c *C) { |
| 8 | ps := []Pattern{ |
| 9 | ParsePattern("**/middle/v[uo]l?ano", nil), |
| 10 | ParsePattern("!volcano", nil), |
| 11 | } |
| 12 | |
| 13 | m := NewMatcher(ps) |
| 14 | c.Assert(m.Match([]string{"head", "middle", "vulkano"}, false), Equals, true) |
| 15 | c.Assert(m.Match([]string{"head", "middle", "volcano"}, false), Equals, false) |
| 16 | } |