MCPcopy Create free account
hub / github.com/go-git/go-git / TestDir_ReadPatterns

Method TestDir_ReadPatterns

plumbing/format/gitattributes/dir_test.go:141–152  ·  view source on GitHub ↗
(c *C)

Source from the content-addressed store, hash-verified

139}
140
141func (s *MatcherSuite) TestDir_ReadPatterns(c *C) {
142 ps, err := ReadPatterns(s.GFS, nil)
143 c.Assert(err, IsNil)
144 c.Assert(ps, HasLen, 2)
145
146 m := NewMatcher(ps)
147 results, _ := m.Match([]string{"vendor", "gopkg.in", "file"}, nil)
148 c.Assert(results["foo"].Value(), Equals, "bar")
149
150 results, _ = m.Match([]string{"vendor", "github.com", "file"}, nil)
151 c.Assert(results["foo"].IsUnset(), Equals, false)
152}
153
154func (s *MatcherSuite) TestDir_LoadGlobalPatterns(c *C) {
155 ps, err := LoadGlobalPatterns(s.RFS)

Callers

nothing calls this directly

Calls 5

MatchMethod · 0.95
ReadPatternsFunction · 0.70
NewMatcherFunction · 0.70
ValueMethod · 0.65
IsUnsetMethod · 0.65

Tested by

no test coverage detected