File: decode_pool_test.go

package info (click to toggle)
golang-github-francoispqt-gojay 1.2.13-5
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, bullseye, sid, trixie
  • size: 1,456 kB
  • sloc: makefile: 86
file content (17 lines) | stat: -rw-r--r-- 366 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
package gojay

import (
	"testing"

	"github.com/stretchr/testify/assert"
)

func TestDecoderBorrowFromPoolSetBuffSize(t *testing.T) {
	dec := borrowDecoder(nil, 512)
	assert.Len(t, dec.data, 512, "data buffer should be of len 512")
}

func TestDecoderNewPool(t *testing.T) {
	dec := newDecoderPool()
	assert.IsType(t, &Decoder{}, dec, "dec should be a *Decoder")
}