Add more tests

This commit is contained in:
anilCSE 2020-01-14 10:35:49 +05:30
parent 2ec1a577c1
commit 10e49dc625
1 changed files with 5 additions and 2 deletions

View File

@ -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)
}