25 Commits

Author SHA1 Message Date
Ryan Roden-Corrent
a7fe78fc68 Write decompressed stdin to stdin-output. 2024-08-26 03:40:52 -03:00
Ryan Roden-Corrent
77c1a4e9db Support decompressing stdin.
Fixes #687.

If "-" is passed as a filename, decompress data from stdin.

Currently `--format` must be passed as well, but as a next step,
we could try to infer the format from magic numbers.

As stdin is not connected to the terminal, we cannot prompt for Y/N
when warning about decompression in memory, for e.g. zip. Just default
to No, and require passing "-y" in these cases.

For zip, we have to buffer the whole stream in memory to seek into it,
just as we do with a chained decoder like `.zip.bz`.

The rar format requires an actual file (not an `impl Read`), so
we write a temp file that it can decode.

When decoding a single-file archive (e.g. file.bz), the output filename
is just `-`, since we don't know the original filename. I had to add
a bit of a hack to the tests to work around this. Another option
would be to interpret "-d" as a destination filename in this case.

When decoding a multi-file archive, I decided to unpack directly into
the destination directory, as this seemed like a better experience than
adding a top-level "-" folder inside the destination.
2024-08-26 03:40:52 -03:00
Ryan Roden-Corrent
4a323aeba8 Fix confusion between empty/nonempty test.
The single_empty_file test was writing random content to the file,
whereas the single_file test was writing an empty file.
Only the latter tested different levels, so I figured that test
was the one that should be using actual file content.
2024-07-14 18:22:44 -03:00
Antonios Barotsis
8e43cd2afa Change existing method docs to valid rustdoc 2024-02-28 20:27:32 -03:00
cyqsimon
fa2d214fee Feature-gate RAR support 2023-12-14 23:32:17 -03:00
João Marcos P. Bezerra
f3db923d83 Decrease memory usage in ARMv7 CI
Our GitHub Actions CI was failing because the ARMv7 systems use QEMU
which consumes more memory than usual, by decreasing the memory usage,
we expect to make it all work again.
2023-11-28 20:29:28 -03:00
figsoda
4bea6af526 add 7z to tests 2023-11-25 21:33:22 -03:00
Łukasz Krawiec
dade163243 added support for listing and decompressing .rar archives 2023-11-15 08:59:00 -03:00
João M. Bezerra
dd51525c6c decrease RAM usage in integration tests
by decreasing the size of extension chains
2023-09-16 15:21:08 -03:00
João M. Bezerra
0151238c87 make CI faster by decreasing size of tests
make fuzzing tests create less files, with half the size and run less
test cases

should speed up by a magnitude of ~5.0x
2023-09-16 15:21:08 -03:00
figsoda
c58d2b416a tests: reduce maximum compression level 2023-03-20 14:35:41 -04:00
xgdgsc
e92b9ff723 option level tests 2023-03-18 12:23:59 +08:00
xgdgsc
653ff976f5 clamp , merge test 2023-03-17 22:09:20 +08:00
xgdgsc
d9ffd42c8f 🐛 fix 2023-03-17 21:36:31 +08:00
xgdgsc
ffa16c7d6e add test, move 2023-03-17 17:59:53 +08:00
João M. Bezerra
14025c6816 remove use_small_heuristics = "Max" from rustfmt
and update edition to 2021
2022-06-04 13:06:52 -03:00
LovecraftianHorror
ec6c3b92a5
Cleanup integration tests (#238)
* Actually fill dummy files with random data

* Switch rem logic to more obvious random range

* Test all available formats

* Enable accessibility mode in tests to drastically reduce runtime
2022-01-13 14:40:03 -03:00
figsoda
52a8acf2e1 support snappy format 2021-12-07 13:59:56 -05:00
João Marcos Bezerra
3bf9a1e7a1 Revert "Add interactive integration tests (#208)"
This reverts commit 4d9f5e412f69e60d0b71819f5f0d8181e42e897e.
2021-11-16 18:25:25 -03:00
sigmaSd
4d9f5e412f
Add interactive integration tests (#208) 2021-11-16 17:43:17 -03:00
Nbiba Bedis
0660c2fe59 Remove Lzip because its incorrect, and improve extention comparison 2021-11-13 09:46:08 +01:00
figsoda
dedd254ace switch from lz4_flex to lzzzz, enable lz4 tests 2021-11-09 21:26:04 -05:00
figsoda
2b9023e180 misc comments and wording changes 2021-11-05 23:27:20 -04:00
figsoda
253cedcf60 crate dir-diff -> fn assert_same_directory 2021-11-05 23:27:20 -04:00
figsoda
35df50857d rewrite tests 2021-11-05 23:27:20 -04:00