@@ -29,6 +29,8 @@ func (s *MatcherSuite) SetUpTest(c *C) {
2929 c .Assert (err , IsNil )
3030 _ , err = f .Write ([]byte ("vendor/g*/\n " ))
3131 c .Assert (err , IsNil )
32+ _ , err = f .Write ([]byte ("ignore.crlf\r \n " ))
33+ c .Assert (err , IsNil )
3234 err = f .Close ()
3335 c .Assert (err , IsNil )
3436
@@ -41,9 +43,14 @@ func (s *MatcherSuite) SetUpTest(c *C) {
4143 err = f .Close ()
4244 c .Assert (err , IsNil )
4345
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 )
4754
4855 s .GFS = fs
4956
@@ -167,9 +174,10 @@ func (s *MatcherSuite) SetUpTest(c *C) {
167174func (s * MatcherSuite ) TestDir_ReadPatterns (c * C ) {
168175 ps , err := ReadPatterns (s .GFS , nil )
169176 c .Assert (err , IsNil )
170- c .Assert (ps , HasLen , 2 )
177+ c .Assert (ps , HasLen , 3 )
171178
172179 m := NewMatcher (ps )
180+ c .Assert (m .Match ([]string {"ignore.crlf" }, true ), Equals , true )
173181 c .Assert (m .Match ([]string {"vendor" , "gopkg.in" }, true ), Equals , true )
174182 c .Assert (m .Match ([]string {"vendor" , "github.com" }, true ), Equals , false )
175183}
0 commit comments