82 Commits

Author SHA1 Message Date
João Marcos P. Bezerra
3d717ec3bc update snapshots 2024-09-07 00:24:50 -03:00
João M. Bezerra
5dac8431f2 Fix --format parsing extensions with dots
Also improve error reporting for `--format` with malformed or
unsupported extensions

This commit is very messy, as it also does an refac in the project,
which should ideally be in a separated commit
2024-09-07 00:24:50 -03:00
ttyS3
8987992c21 chore: fix tests 2024-09-06 21:47:03 -03:00
ttyS3
058be43cf4 test: fix warning: use of deprecated macro ui (it's alias, actual is insta::assert_display_snapshot): use assert_snapshot!() instead 2024-09-06 21:47:03 -03:00
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
c4f2f6fcb6 fmt 2024-02-28 20:27:32 -03:00
Antonios Barotsis
8e43cd2afa Change existing method docs to valid rustdoc 2024-02-28 20:27:32 -03:00
Antonios Barotsis
c894829c37 Silence invalid clippy lint (windows) 2024-02-28 20:27:32 -03:00
Antonios Barotsis
f847040e69 Fix clippy performance lint
See https://rust-lang.github.io/rust-clippy/master/index.html#slow_vector_initialization
2024-02-28 20:27:32 -03:00
Antonios Barotsis
63ad6b419c Replace shell commands with File::create 2024-02-28 20:27:32 -03:00
cyqsimon
fa2d214fee Feature-gate RAR support 2023-12-14 23:32:17 -03:00
cyqsimon
1c30f51051 Make test outputs identical on all platforms 2023-12-13 19:32:55 -03:00
cyqsimon
23936c3d2c Run tests on every target 2023-12-13 19:32:55 -03:00
João Marcos P. Bezerra
4314a3bbdd Mention Rar support in README and help 2023-12-05 13:04:08 -03:00
Ilya Grigoriev
e2796cef78 Mention 7z support in README and help 2023-12-05 13:04:08 -03:00
Ilya Grigoriev
9f82c9a655 Clarify that .sz refers to Google's Snappy format
It needs to be disambiguated from the unfortunately named
SZ compression, see https://szcompressor.org/.

Fixes #563
2023-12-05 13:04:08 -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
João Marcos P. Bezerra
d07c65508a Removing redundant code 2023-11-25 21:33:22 -03:00
Flat
69b1db4a35 chore: cargo fmt 2023-11-25 21:33:22 -03:00
Flat
97b4356aa8 feat: implement 7zip support for compression and decompression
This also fixes symlink canonicalization for Windows and fixes UI tests on Windows.
2023-11-25 21:33:22 -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
a26d3d34ce Improve hints when decompressing with no extension
refactored `check_missing_formats_when_decompressing` to be aware of
missing extensions and unsupported extensions in order to give a more
detailed error message
2023-09-17 20:05:54 -03:00
João M. Bezerra
bc1d9457f0 ui tests: fix for MacOS and skip for Windows 2023-09-17 19:06:14 -03:00
João M. Bezerra
af7e95ae98 add UI tests guide in CONTRIBUTING.md 2023-09-17 19:06:14 -03:00
João M. Bezerra
192eaca5dc add ui snapshot tests
these tests are used to assert on Ouch's output for error reports and
progress logging
2023-09-17 19:06:14 -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
figsoda
fe464213b3 fix typos 2023-01-31 14:21:19 -05:00
João M. Bezerra
c737956a4e check for EOF when asking questions
when invoking Ouch from shell scripts, it is likely that questions will
be left unanswered with EOF, this commit fixes Ouch interpreting EOF as
Yes in Y/N questions
2022-11-23 00:43:53 -03:00
figsoda
628e14f281 reactivate ci targets for arm linux and windows mingw 2022-10-14 14:33:00 -04: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
figsoda
296826b4d3 add support for lz4 format 2021-11-02 17:37:24 -04:00
João M. Bezerra
27b6970eda Updating rustfmt 2021-11-02 16:15:36 -03:00