initial import
This commit is contained in:
23
core/codec/gzip_test.go
Normal file
23
core/codec/gzip_test.go
Normal file
@@ -0,0 +1,23 @@
|
||||
package codec
|
||||
|
||||
import (
|
||||
"bytes"
|
||||
"fmt"
|
||||
"testing"
|
||||
|
||||
"github.com/stretchr/testify/assert"
|
||||
)
|
||||
|
||||
func TestGzip(t *testing.T) {
|
||||
var buf bytes.Buffer
|
||||
for i := 0; i < 10000; i++ {
|
||||
fmt.Fprint(&buf, i)
|
||||
}
|
||||
|
||||
bs := Gzip(buf.Bytes())
|
||||
actual, err := Gunzip(bs)
|
||||
|
||||
assert.Nil(t, err)
|
||||
assert.True(t, len(bs) < buf.Len())
|
||||
assert.Equal(t, buf.Bytes(), actual)
|
||||
}
|
||||
Reference in New Issue
Block a user