gojay

high performance JSON encoder/decoder with stream API for Golang
git clone git://git.lair.cx/gojay
Log | Files | Refs | README | LICENSE

decode_pool_test.go (366B)


      1 package gojay
      2 
      3 import (
      4 	"testing"
      5 
      6 	"github.com/stretchr/testify/assert"
      7 )
      8 
      9 func TestDecoderBorrowFromPoolSetBuffSize(t *testing.T) {
     10 	dec := borrowDecoder(nil, 512)
     11 	assert.Len(t, dec.data, 512, "data buffer should be of len 512")
     12 }
     13 
     14 func TestDecoderNewPool(t *testing.T) {
     15 	dec := newDecoderPool()
     16 	assert.IsType(t, &Decoder{}, dec, "dec should be a *Decoder")
     17 }