MCPcopy Index your code
hub / github.com/go-git/go-git / TestPutCacheOverflow

Method TestPutCacheOverflow

plumbing/cache/object_test.go:75–92  ·  view source on GitHub ↗
(c *C)

Source from the content-addressed store, hash-verified

73}
74
75func (s *ObjectSuite) TestPutCacheOverflow(c *C) {
76 // this test only works with an specific size
77 o := s.c["two_bytes"]
78
79 o.Put(s.aObject)
80 o.Put(s.cObject)
81 o.Put(s.dObject)
82
83 obj, ok := o.Get(s.aObject.Hash())
84 c.Assert(ok, Equals, false)
85 c.Assert(obj, IsNil)
86 obj, ok = o.Get(s.cObject.Hash())
87 c.Assert(ok, Equals, true)
88 c.Assert(obj, NotNil)
89 obj, ok = o.Get(s.dObject.Hash())
90 c.Assert(ok, Equals, true)
91 c.Assert(obj, NotNil)
92}
93
94func (s *ObjectSuite) TestEvictMultipleObjects(c *C) {
95 o := s.c["two_bytes"]

Callers

nothing calls this directly

Calls 3

PutMethod · 0.65
GetMethod · 0.65
HashMethod · 0.65

Tested by

no test coverage detected