MCPcopy Create free account
hub / github.com/djherbis/buffer / TestPool

Function TestPool

buffer_test.go:23–31  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

21}
22
23func TestPool(t *testing.T) {
24 pool := NewPool(func() Buffer { return New(10) })
25 buf, err := pool.Get()
26 if err != nil {
27 t.Error(err)
28 }
29 buf.Write([]byte("hello world"))
30 pool.Put(buf)
31}
32
33func TestMemPool(t *testing.T) {
34 p := NewMemPool(10)

Callers

nothing calls this directly

Calls 5

GetMethod · 0.95
PutMethod · 0.95
NewPoolFunction · 0.85
NewFunction · 0.85
WriteMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…