mirror of
https://github.com/asadbek064/hyparquet.git
synced 2025-12-06 06:51:54 +00:00
Snappy jpg test
This commit is contained in:
parent
00cbb6a3e6
commit
d0213bf0f1
BIN
test/files/hyparquet.jpg.snappy
Normal file
BIN
test/files/hyparquet.jpg.snappy
Normal file
Binary file not shown.
@ -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))
|
||||
|
||||
Loading…
Reference in New Issue
Block a user