From 2efd9629848552626ee35fc2d8e622f4cf538fcd Mon Sep 17 00:00:00 2001 From: Alex Peters Date: Mon, 9 Nov 2020 08:50:10 +0100 Subject: [PATCH] Add test to very limit on uncompressed data --- x/wasm/internal/keeper/ioutil_test.go | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/x/wasm/internal/keeper/ioutil_test.go b/x/wasm/internal/keeper/ioutil_test.go index 6a583a781b..972a3ed495 100644 --- a/x/wasm/internal/keeper/ioutil_test.go +++ b/x/wasm/internal/keeper/ioutil_test.go @@ -44,10 +44,14 @@ func TestUncompress(t *testing.T) { src: []byte{0x1, 0x2}, expResult: []byte{0x1, 0x2}, }, - "handle big input slice": { + "handle input slice exceeding limit": { src: []byte(strings.Repeat("a", maxSize+1)), expError: types.ErrLimit, }, + "handle input slice at limit": { + src: []byte(strings.Repeat("a", maxSize)), + expResult: []byte(strings.Repeat("a", maxSize)), + }, "handle gzip identifier only": { src: gzipIdent, expError: io.ErrUnexpectedEOF,