Skip to content

Latest commit

 

History

History
21 lines (15 loc) · 1.56 KB

fixtures.md

File metadata and controls

21 lines (15 loc) · 1.56 KB

Test fixtures

All fixtures are generated by scripts/generate-fixtures.ts. Nothing binary is checked in.

npm run fixtures

The script writes to fixtures/ (ignored by git) and records every file in fixtures/manifest.json. The test suite runs the same generator before the tests start. Generation is deterministic: the same commit produces the same bytes.

Directory Format Samples What varies
fixtures/png PNG 6 size, color type, optional tEXt, one to three IDAT chunks
fixtures/zip ZIP 6 one to five entries, stored and deflated entries
fixtures/wav WAV (RIFF) 6 channels, sample rate, length, optional LIST and odd-sized JUNK chunks
fixtures/hxsf HXSF, designed for this repository 6 one to six entries, version 1 or 2, zlib text, raw tables, random noise
fixtures/compression zlib, gzip, raw deflate, LZ4, Zstandard, random and plain data 8 one stream each, embedded after a 23-byte header; the manifest records its offset and sizes

HXSF is a format made up for the tests. It has a header, an offset table, a string pool of null-terminated names and a data area with zlib-compressed and uncompressed sections. Its structure is intentionally not described here: docs/showcases/hxsf.md recovers it from the samples. The generator in scripts/fixtures/hxsf.ts is the ground truth.

The noise entries in HXSF samples are random bytes. They stand in for data that cannot be analyzed further, so the tools must report them as possibly-encrypted and stop.