36 Commits

Author SHA1 Message Date
tommady
b9b1e11303
Store symlinks by default and add --follow-symlinks to toggle it (#789) 2025-04-16 17:43:46 -03:00
João Marcos P. Bezerra
e405690d35 chore: tweak tests so they run faster 2024-11-20 05:23:20 -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
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
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
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
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
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
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
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
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
João M. Bezerra
27b6970eda Updating rustfmt 2021-11-02 16:15:36 -03:00
João M. Bezerra
a85eb68a60 Merge branch 'pr/completions-manpage' 2021-10-31 02:23:21 -03:00
João M. Bezerra
4e731f8af3 Merge branch 'dir-flag' 2021-10-31 01:49:33 -03:00
figsoda
614f2aa6d5
Merge branch 'master' into completions-manpage 2021-10-30 16:59:24 -04:00
Gabriel Simonetto
704a4efdd7 Merge branch 'master' into issue-56 2021-10-30 11:31:09 -03:00
Gabriel Simonetto
09b050d836 Introduce fs_err as a replacement for fs 2021-10-30 11:17:38 -03:00
figsoda
d6054ba3ee move QuestionPolicy to lib 2021-10-21 19:13:29 -04:00
figsoda
2816b837e2
Merge branch 'master' into completions-manpage 2021-10-21 18:57:24 -04:00
Anton Hermann
10f7462b8b Introduce new type for policy on how to handle questions 2021-10-21 23:31:53 +02:00
figsoda
7efac2e55d generate completions 2021-10-20 22:18:39 -04:00
Spyros Roum
bc33ccc99c Update tests 2021-10-19 14:55:37 +03:00
figsoda
1acf6e4d35 tests: apply clippy lints 2021-10-16 10:10:48 -04:00
João M. Bezerra
89d1e6a752 Document modules 2021-10-03 00:17:57 -03:00
João Marcos Bezerra
7178ae84ff
Fix tests/utils.rs warning suppresion 2021-10-02 23:40:51 -03:00
João M. Bezerra
d43a93d8bb Moving some tests utilities to tests/utils.rs 2021-10-02 17:12:59 -03:00