1
0
mirror of https://github.com/fumiama/orbyte.git synced 2026-06-06 02:30:30 +08:00
Files
orbyte/pbuf/pbuf_test.go
源文雨 eec7c4821d init
2025-02-24 23:52:18 +09:00

22 lines
292 B
Go

package pbuf
import (
"crypto/rand"
"runtime"
"testing"
)
func TestBytes(t *testing.T) {
for i := 0; i < 4096; i++ {
b := NewBytes(i)
rand.Read(b.Bytes())
b.Destroy()
}
runtime.GC()
out, in := bufferPool.p.CountItems()
t.Log(out, in)
if out != 0 || in != 1 {
t.Fail()
}
}