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

Method TestPutCacheOverflow

plumbing/cache/buffer_test.go:72–89  ·  view source on GitHub ↗
(c *C)

Source from the content-addressed store, hash-verified

70}
71
72func (s *BufferSuite) TestPutCacheOverflow(c *C) {
73 // this test only works with an specific size
74 o := s.c["two_bytes"]
75
76 o.Put(1, s.aBuffer)
77 o.Put(2, s.cBuffer)
78 o.Put(3, s.dBuffer)
79
80 obj, ok := o.Get(1)
81 c.Assert(ok, Equals, false)
82 c.Assert(obj, IsNil)
83 obj, ok = o.Get(2)
84 c.Assert(ok, Equals, true)
85 c.Assert(obj, NotNil)
86 obj, ok = o.Get(3)
87 c.Assert(ok, Equals, true)
88 c.Assert(obj, NotNil)
89}
90
91func (s *BufferSuite) TestEvictMultipleBuffers(c *C) {
92 o := s.c["two_bytes"]

Callers

nothing calls this directly

Calls 2

PutMethod · 0.65
GetMethod · 0.65

Tested by

no test coverage detected