alpha
Login
or
Join now
mary.my.id
/
pkg-7zip
Star
0
Fork
0
Atom
Configure Feed
Issues
Pull Requests
Commits
Tags
Feed URL
Select the types of activity you want to include in your feed.
streaming 7-Zip archive extractor
Star
0
Fork
0
Atom
Configure Feed
Issues
Pull Requests
Commits
Tags
Feed URL
Select the types of activity you want to include in your feed.
Overview
Issues
Pulls
Pipelines
pkg-7zip
/
tests
1 folder
6 files
at
trunk
Mary
fix: terminate the Blob reader stream once the slice is delivered
7w ago
9d07d503
fixtures
feat: add LZMA1 streaming decoder ports the range decoder, LZ window, and the LZMA arithmetic model from hasenbanck/lzma-rust2 (itself a port of tukaani's xz-for-java). the state machine, literal coder, match-len coder, and rep-len coder all match the reference; only the streaming wrapper diverges to fit the StreamReader-shaped byte source the rest of this library already uses. the range decoder buffers its input internally and throws RangeUnderflow when the caller hasn't fed enough bytes. the public decodeLzmaStream async generator catches that signal, refills from the source, and resumes — the LZMA state is rolled back to the start of the in-flight decode step before the underflow. tested against three .lzma fixtures generated with /usr/bin/lzma: small lipsum, 285 KB of repeated lorem, and 11 KB of English prose. all roundtrip to byte-identical plaintext.
2 months ago
container.test.ts
fix: terminate the Blob reader stream once the slice is delivered
1 month ago
cursor.test.ts
chore: add unit tests for Cursor and bool-vector helpers
2 months ago
errors.test.ts
feat: surface InvalidPasswordError on wrong-password failures wrong AES keys decrypt the pack stream to garbage, which up to now bubbled up as MalformedArchiveError (LZMA range decoder) or as a header parse error on encrypted EncodedHeaders. wrap folder decode, encoded-header decode, and the subsequent parseHeader call: when the affected folder includes an AES coder and the caller supplied a password, swap the error for InvalidPasswordError so a retry-with-different-password flow is catchable.
2 months ago
extract.test.ts
feat: extend extract tests with unused fixtures and entry API surface adds happy-path tests for umlaut, longpath, extra_payload_data, read_reset, hidden_linux_file/folder, extract_second, bla-nonames, and times.7z. covers the SevenZipEntry public surface that wasn't exercised before: arrayBuffer, blob, json, body (as stream), crc32, mtime/ctime/atime, isAntiItem.
2 months ago
lzma.test.ts
fix: decode LZMA1 streams safely across chunk refills two interacting bugs corrupted any LZMA1 stream that didn't fit in the StreamReader's initial buffer (LZMA2 was unaffected because each chunk is fully buffered before decode). 1. `LzmaDecoder.decode` wrapped each decode step in try/catch on a RangeUnderflow exception, snapshotting range/code/reps/state to roll back. but every `decodeBit` call also mutates the probability tables (`probs[idx] = ...`), and the snapshot never restored those. on retry the decoder ran with already-shifted probabilities, decoded the wrong bit, and produced bogus distances downstream — manifesting as `LZMA distance overflow: dist=<huge> full=<small>`. 2. `decodeLzmaStream` always passed `exhausted=true` when refilling: it checked `input.buffered === 0` *after* draining via take(), which is trivially true. that masked the upstream's true end-of-stream signal, and after the snapshot rework the decoder treated every refill as the last one — reading zero padding past the live buffer and again producing corrupt output. replaces the snapshot+throw pattern with a pre-buffering watermark: `RangeDecoder.canStep` reports whether enough bytes are buffered for any single decode step (worst-case 48 bytes derived from the longest match path). `decode` returns false when below the watermark *and* the upstream isn't yet exhausted. on real end-of-stream, `#readByte` returns zero padding (matching the LZMA encoder convention) so the final output bits still decode. the caller's refill loop now passes `input.done` so the exhaustion signal is honest. `ByteSource` gains a `done` readonly so both the StreamReader and the inter-coder IteratorByteSource expose this signal uniformly. regression test fragments a real LZMA1 fixture into 7-byte chunks to drive the multi-feed path that the prior tests never exercised.
2 months ago
reader.test.ts
fix: terminate the Blob reader stream once the slice is delivered
1 month ago