(t *testing.T)
| 31 | } |
| 32 | |
| 33 | func 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 | |
| 51 | func poolTest(pool Pool, t *testing.T) { |
| 52 | buf, err := pool.Get() |
nothing calls this directly
no test coverage detected
searching dependent graphs…