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

Function TestMemPool

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

Source from the content-addressed store, hash-verified

31}
32
33func TestMemPool(t *testing.T) {
34 p := NewMemPool(10)
35 poolTest(p, t)
36
37 b := bytes.NewBuffer(nil)
38 enc := gob.NewEncoder(b)
39 if err := enc.Encode(&p); err != nil {
40 t.Error(err)
41 }
42
43 var pool Pool
44 dec := gob.NewDecoder(b)
45 if err := dec.Decode(&pool); err != nil {
46 t.Error(err)
47 }
48 poolTest(pool, t)
49}
50
51func poolTest(pool Pool, t *testing.T) {
52 buf, err := pool.Get()

Callers

nothing calls this directly

Calls 2

NewMemPoolFunction · 0.85
poolTestFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…