@@ -29,6 +29,8 @@ func (s *MatcherSuite) SetUpTest(c *C) {
29
29
c .Assert (err , IsNil )
30
30
_ , err = f .Write ([]byte ("vendor/g*/\n " ))
31
31
c .Assert (err , IsNil )
32
+ _ , err = f .Write ([]byte ("ignore.crlf\r \n " ))
33
+ c .Assert (err , IsNil )
32
34
err = f .Close ()
33
35
c .Assert (err , IsNil )
34
36
@@ -41,9 +43,14 @@ func (s *MatcherSuite) SetUpTest(c *C) {
41
43
err = f .Close ()
42
44
c .Assert (err , IsNil )
43
45
44
- fs .MkdirAll ("another" , os .ModePerm )
45
- fs .MkdirAll ("vendor/github.com" , os .ModePerm )
46
- fs .MkdirAll ("vendor/gopkg.in" , os .ModePerm )
46
+ err = fs .MkdirAll ("another" , os .ModePerm )
47
+ c .Assert (err , IsNil )
48
+ err = fs .MkdirAll ("ignore.crlf" , os .ModePerm )
49
+ c .Assert (err , IsNil )
50
+ err = fs .MkdirAll ("vendor/github.com" , os .ModePerm )
51
+ c .Assert (err , IsNil )
52
+ err = fs .MkdirAll ("vendor/gopkg.in" , os .ModePerm )
53
+ c .Assert (err , IsNil )
47
54
48
55
s .GFS = fs
49
56
@@ -167,9 +174,10 @@ func (s *MatcherSuite) SetUpTest(c *C) {
167
174
func (s * MatcherSuite ) TestDir_ReadPatterns (c * C ) {
168
175
ps , err := ReadPatterns (s .GFS , nil )
169
176
c .Assert (err , IsNil )
170
- c .Assert (ps , HasLen , 2 )
177
+ c .Assert (ps , HasLen , 3 )
171
178
172
179
m := NewMatcher (ps )
180
+ c .Assert (m .Match ([]string {"ignore.crlf" }, true ), Equals , true )
173
181
c .Assert (m .Match ([]string {"vendor" , "gopkg.in" }, true ), Equals , true )
174
182
c .Assert (m .Match ([]string {"vendor" , "github.com" }, true ), Equals , false )
175
183
}
0 commit comments