aboutsummaryrefslogtreecommitdiffstats
path: root/plumbing/format/gitignore/matcher_test.go
diff options
context:
space:
mode:
Diffstat (limited to 'plumbing/format/gitignore/matcher_test.go')
-rw-r--r--plumbing/format/gitignore/matcher_test.go15
1 files changed, 7 insertions, 8 deletions
diff --git a/plumbing/format/gitignore/matcher_test.go b/plumbing/format/gitignore/matcher_test.go
index 268e1c0..7311042 100644
--- a/plumbing/format/gitignore/matcher_test.go
+++ b/plumbing/format/gitignore/matcher_test.go
@@ -1,17 +1,16 @@
package gitignore
-import "testing"
+import (
+ . "gopkg.in/check.v1"
+)
-func TestMatcher_Match(t *testing.T) {
+func (s *MatcherSuite) TestMatcher_Match(c *C) {
ps := []Pattern{
ParsePattern("**/middle/v[uo]l?ano", nil),
ParsePattern("!volcano", nil),
}
+
m := NewMatcher(ps)
- if !m.Match([]string{"head", "middle", "vulkano"}, false) {
- t.Errorf("expected a match, found mismatch")
- }
- if m.Match([]string{"head", "middle", "volcano"}, false) {
- t.Errorf("expected a mismatch, found a match")
- }
+ c.Assert(m.Match([]string{"head", "middle", "vulkano"}, false), Equals, true)
+ c.Assert(m.Match([]string{"head", "middle", "volcano"}, false), Equals, false)
}