initial import

This commit is contained in:
kevin
2020-07-26 17:09:05 +08:00
commit 7e3a369a8f
647 changed files with 54754 additions and 0 deletions

23
core/codec/gzip_test.go Normal file
View 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)
}