Files
mautrix-telegram/pkg/gotd/bin/pool_test.go
T
2025-06-27 20:03:37 -07:00

25 lines
317 B
Go

package bin
import (
"testing"
"github.com/stretchr/testify/require"
)
func TestPool_GetSize(t *testing.T) {
sizes := []int{0, 1024}
for _, size := range sizes {
a := require.New(t)
p := NewPool(size)
b := p.Get()
a.Empty(b.Buf)
p.Put(b)
b = p.GetSize(1024)
a.Len(b.Buf, 1024)
p.Put(b)
}
}