initial import
This commit is contained in:
15
core/iox/bufferpool_test.go
Normal file
15
core/iox/bufferpool_test.go
Normal file
@@ -0,0 +1,15 @@
|
||||
package iox
|
||||
|
||||
import (
|
||||
"bytes"
|
||||
"testing"
|
||||
|
||||
"github.com/stretchr/testify/assert"
|
||||
)
|
||||
|
||||
func TestBufferPool(t *testing.T) {
|
||||
capacity := 1024
|
||||
pool := NewBufferPool(capacity)
|
||||
pool.Put(bytes.NewBuffer(make([]byte, 0, 2*capacity)))
|
||||
assert.True(t, pool.Get().Cap() <= capacity)
|
||||
}
|
||||
Reference in New Issue
Block a user