mirror of https://github.com/certusone/wasmd.git
Add more tests
This commit is contained in:
parent
2ec1a577c1
commit
10e49dc625
|
@ -46,6 +46,9 @@ func TestIsGzip (t *testing.T) {
|
|||
|
||||
func TestGzipIt (t *testing.T) {
|
||||
wasmCode, someRandomStr, _, err := GetTestData()
|
||||
originalGzipData := []byte{31, 139, 8, 0, 0, 0, 0, 0, 0, 255, 202, 72, 205, 201, 201, 87, 40, 207, 47, 202, 73, 1,
|
||||
4, 0, 0, 255, 255, 133, 17, 74, 13, 11, 0, 0, 0}
|
||||
|
||||
require.NoError(t, err)
|
||||
|
||||
t.Log("gzip wasm with no error")
|
||||
|
@ -54,8 +57,8 @@ func TestGzipIt (t *testing.T) {
|
|||
|
||||
t.Log("gzip of a string should return exact gzip data")
|
||||
strToGzip, err := GzipIt(someRandomStr)
|
||||
originalGzipData := []byte{31, 139, 8, 0, 0, 0, 0, 0, 0, 255, 202, 72, 205, 201, 201, 87, 40, 207, 47, 202, 73, 1,
|
||||
4, 0, 0, 255, 255, 133, 17, 74, 13, 11, 0, 0, 0}
|
||||
|
||||
require.True(t, IsGzip(strToGzip))
|
||||
require.NoError(t, err)
|
||||
require.Equal(t, originalGzipData, strToGzip)
|
||||
}
|
Loading…
Reference in New Issue