aboutsummaryrefslogblamecommitdiffstats
path: root/plumbing/format/gitignore/matcher_test.go
blob: 731104256edaa6f1383edf358032e0b7f4180bbd (plain) (tree)
1
2
3
4
5
6
7
8
9
10
11

                 


                             
 
                                                



                                                          
 
                           

                                                                                      
 
package gitignore

import (
	. "gopkg.in/check.v1"
)

func (s *MatcherSuite) TestMatcher_Match(c *C) {
	ps := []Pattern{
		ParsePattern("**/middle/v[uo]l?ano", nil),
		ParsePattern("!volcano", nil),
	}

	m := NewMatcher(ps)
	c.Assert(m.Match([]string{"head", "middle", "vulkano"}, false), Equals, true)
	c.Assert(m.Match([]string{"head", "middle", "volcano"}, false), Equals, false)
}