github.com/vicanso/pike@v1.0.1-0.20210630235453-9099e041f6ec/compress/zstd_test.go (about)

     1  package compress
     2  
     3  import (
     4  	"testing"
     5  
     6  	"github.com/stretchr/testify/assert"
     7  )
     8  
     9  func TestDoZSTDDecode(t *testing.T) {
    10  	assert := assert.New(t)
    11  	data := compressTestData
    12  	dst, err := doZSTDEncode(data, 1)
    13  	assert.Nil(err)
    14  	assert.NotNil(dst)
    15  	assert.NotEqual(data, dst)
    16  
    17  	buf, err := doZSTDDecode(dst)
    18  	assert.Nil(err)
    19  	assert.Equal(data, buf)
    20  }