influxdb/pkg/pool/bytes_test.go

17 lines
341 B
Go
Raw Normal View History

2018-09-28 14:51:47 +00:00
package pool_test
import (
"testing"
"github.com/influxdata/influxdb/pkg/pool"
2018-09-28 14:51:47 +00:00
)
func TestLimitedBytePool_Put_MaxSize(t *testing.T) {
bp := pool.NewLimitedBytes(1, 10)
bp.Put(make([]byte, 1024)) // should be dropped
if got, exp := cap(bp.Get(10)), 10; got != exp {
t.Fatalf("max cap size exceeded: got %v, exp %v", got, exp)
}
}