hcrosse commented on code in PR #1530:
URL: https://github.com/apache/arrow-go/pull/1530#discussion_r4544095852


##########
parquet/compress/compress_test.go:
##########
@@ -259,6 +259,21 @@ func TestBrotliCompressBound(t *testing.T) {
        }
 }
 
+func TestBrotliDecodeDestinationSize(t *testing.T) {
+       codec, err := compress.GetCodec(compress.Codecs.Brotli)
+       assert.NoError(t, err)
+       // This stream is 32769 bytes, so the decoder's second 32 KiB read 
holds only the final empty metablock.
+       data := makeRandomData(32765)
+       compressed := codec.Encode(nil, data)
+
+       out, err := compress.Decode(codec, make([]byte, len(data)), compressed)
+       assert.NoError(t, err)
+       assert.Equal(t, data, out)
+
+       _, err = compress.Decode(codec, make([]byte, len(data)-1), compressed)
+       assert.EqualError(t, err, "codec: brotli: decoded data exceeds 
destination size 32764")

Review Comment:
   Thanks, switched to `ErrorContains`.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to