aboutsummaryrefslogtreecommitdiffstats
path: root/plumbing/format/gitignore/matcher_test.go
diff options
context:
space:
mode:
authorMáximo Cuadros <mcuadros@gmail.com>2017-06-19 10:26:03 +0200
committerMáximo Cuadros <mcuadros@gmail.com>2017-06-19 10:26:03 +0200
commit3ae5d4de35e76f2f573b550d93bb2aed8137f1cb (patch)
treeab3c103c09dd6eaf07c99de04b643869eca1a7ce /plumbing/format/gitignore/matcher_test.go
parent93633b5767b0d571bedc724364209d30f96a7b17 (diff)
downloadgo-git-3ae5d4de35e76f2f573b550d93bb2aed8137f1cb.tar.gz
plumbing: gitignore, upgrade to go-billy.v3 and test with gocheck
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)
}