diff --git a/test/files/hyparquet.jpg.snappy b/test/files/hyparquet.jpg.snappy new file mode 100644 index 0000000..2dd4148 Binary files /dev/null and b/test/files/hyparquet.jpg.snappy differ diff --git a/test/snappy.test.js b/test/snappy.test.js index f199836..8718ffe 100644 --- a/test/snappy.test.js +++ b/test/snappy.test.js @@ -1,3 +1,4 @@ +import fs from 'fs' import { describe, expect, it } from 'vitest' import { snappyUncompress } from '../src/snappy.js' @@ -50,6 +51,14 @@ describe('snappy uncompress', () => { await Promise.all(futures) }) + it('decompress hyparquet.jpg.snappy', async () => { + const compressed = fs.readFileSync('test/files/hyparquet.jpg.snappy') + const expected = fs.readFileSync('hyparquet.jpg') + const output = new Uint8Array(expected.length) + await snappyUncompress(compressed, output) + expect(Array.from(output)).toEqual(Array.from(expected)) + }) + it('throws for invalid input', () => { const output = new Uint8Array(10) expect(() => snappyUncompress(new Uint8Array([]), output))