github.com/sandwich-go/boost@v1.3.29/xcompress/snappy_test.go (about)

     1  package xcompress
     2  
     3  import (
     4  	. "github.com/smartystreets/goconvey/convey"
     5  	"testing"
     6  )
     7  
     8  func TestSnappy(t *testing.T) {
     9  	Convey("snappy flat/inflate", t, func() {
    10  		for _, frame := range getTestFrames() {
    11  			c, err0 := newSnappyCompressor()
    12  			So(err0, ShouldBeNil)
    13  			So(c, ShouldNotBeNil)
    14  
    15  			testFlatAndInflate(c, frame)
    16  		}
    17  	})
    18  
    19  	Convey("snappy flat/inflate n times", t, func() {
    20  		for _, frame := range getTestFrames() {
    21  			c, err := newSnappyCompressor()
    22  			So(err, ShouldBeNil)
    23  			So(c, ShouldNotBeNil)
    24  
    25  			testNFlatAndInflate(c, frame, 10)
    26  		}
    27  	})
    28  }