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

Method TestEvictMultipleObjects

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

Source from the content-addressed store, hash-verified

92}
93
94func (s *ObjectSuite) TestEvictMultipleObjects(c *C) {
95 o := s.c["two_bytes"]
96
97 o.Put(s.cObject)
98 o.Put(s.dObject) // now cache is full with two objects
99 o.Put(s.eObject) // this put should evict all previous objects
100
101 obj, ok := o.Get(s.cObject.Hash())
102 c.Assert(ok, Equals, false)
103 c.Assert(obj, IsNil)
104 obj, ok = o.Get(s.dObject.Hash())
105 c.Assert(ok, Equals, false)
106 c.Assert(obj, IsNil)
107 obj, ok = o.Get(s.eObject.Hash())
108 c.Assert(ok, Equals, true)
109 c.Assert(obj, NotNil)
110}
111
112func (s *ObjectSuite) TestClear(c *C) {
113 for _, o := range s.c {

Callers

nothing calls this directly

Calls 3

PutMethod · 0.65
GetMethod · 0.65
HashMethod · 0.65

Tested by

no test coverage detected