Files
go-common/app/service/main/broadcast/libs/bytes/buffer_test.go
2019-04-22 18:49:16 +08:00

22 lines
322 B
Go

package bytes
import (
"testing"
)
func TestBuffer(t *testing.T) {
p := NewPool(2, 10)
b := p.Get()
if b.Bytes() == nil || len(b.Bytes()) == 0 {
t.FailNow()
}
b = p.Get()
if b.Bytes() == nil || len(b.Bytes()) == 0 {
t.FailNow()
}
b = p.Get()
if b.Bytes() == nil || len(b.Bytes()) == 0 {
t.FailNow()
}
}