1
Fork 0
mirror of https://github.com/RGBCube/uutils-coreutils synced 2025-07-27 19:17:43 +00:00
Commit graph

34 commits

Author SHA1 Message Date
Dorian Peron
6e23d4e979 tests: patch tests to simplify imports 2025-07-01 03:36:46 +02:00
Daniel Hofstetter
d5b6af5216 csplit: only allow ASCII digits as offset 2025-05-28 16:07:45 +02:00
Daniel Hofstetter
7439050d85 csplit: only allow ASCII digits for repeat pattern 2025-05-28 15:53:54 +02:00
Jeremy Smart
a752f73476
csplit: don't add a newline if the file doesn't end with one (#7901)
* csplit: don't add a newline if the file doesn't end with one

* refactor test

* refactor
2025-05-09 09:15:54 +02:00
Yuri Astrakhan
47b10539d0 chore: use inline formatting
Minor cleanup using clippy autofix.  This makes the code a bit more readable, and helps spot a few inefficiencies and possible bugs.

```
cargo clippy --fix --workspace -- -A clippy::all -W clippy::uninlined_format_args && cargo fmt
```
2025-04-07 22:56:21 -04:00
Sylvestre Ledru
a0179ea239 uutests: adjust the tests to use them 2025-03-28 21:40:31 +01:00
Sylvestre Ledru
3e1adf40ee Use the new function 'fails_with_code' v2 2025-03-04 09:27:47 +01:00
Sylvestre Ledru
18cb7dcf9e Use the new function fails_with_code
Done with
```
$ perl -0777 -i -pe 's/([ \t]+)\.fails\(\)[ \t]*\n[ \t]+\.no_stdout\(\)[ \t]*\n[ \t]+\.code_is\(([0-9]+)\);/\1.fails_with_code(\2)\n\1.no_stdout();/gs' *rs
$ sed -i -e "s|.fails()(.*).code_is(|.fails_with_code(|g" *rs
$ perl -0777 -i -pe 's/([ \t]+)\.fails\(\)[ \t]*\n[ \t]+\.code_is\(([0-9]+)\);/\1.fails_with_code(\2);/gs' *rs
$ perl -0777 -i -pe 's/([ \t]+)\.fails\(\)(.*?)[ \t]+\.code_is\(([0-9]+)\);/\1.fails_with_code(\3)\2;/gs' *rs
...
```
2025-03-01 17:26:20 +01:00
Jeffrey Finkelstein
18f9ca9da4 csplit: don't panic on missing suppressed file
Avoid a panic that would occur when attempting to remove a file that
didn't exist. This would happen when scanning for a regular expression
match, advancing by a positive offset, and suppressing empty files. For
example, before this commit,

    echo a | csplit -z - %a%1

would cause a panic. After this commit, the process terminates as
expected: without error, without output, and without any files written.

Fixes #7251.
2025-02-09 22:04:47 -05:00
Daniel Hofstetter
6096767442 csplit: simplify test 2025-01-09 15:20:22 +01:00
Fuad Ismail
a4fdecbf48 tests/csplit: use printf instead of echo -n for maximum portability with all UNIX systems 2025-01-09 10:52:19 +01:00
Fuad Ismail
981019138d tests/csplit: ignore IRWXU from cspell check 2025-01-09 10:52:19 +01:00
Fuad Ismail
96929734ea tests/csplit: modify no_such_file test expected error to conform better with original csplit error 2025-01-09 10:52:19 +01:00
Fuad Ismail
c8bc5d2455 tests/csplit: handle directory input file test for Windows separately 2025-01-09 10:52:19 +01:00
Fuad Ismail
19f990f29a tests/csplit: add directory input file test. 2025-01-09 10:52:19 +01:00
Fuad Ismail
1dc463fd26 tests/csplit: add named pipe input file test. 2025-01-09 10:52:19 +01:00
Tommaso Fellegara
33ac58383c
csplit: fix bug when --suppress-matched flag is active and positive/negative offset is present (#7088)
* tests/csplit: modified test test_up_to_match_offset_option_suppress_matched according to issue #7052 and modified also test_up_to_match_negative_offset_option_suppress_matched

* csplit: managed the positive and negative offset when the --suppressed-matched flag is active

* tests/csplit: modified test test_up_to_match_offset_option_suppress_matched according to issue #7052 and modified also test_up_to_match_negative_offset_option_suppress_matched

* csplit: managed the positive and negative offset when the --suppressed-matched flag is active

* csplit: swapped if and else blocks for better readability
2025-01-09 09:20:48 +01:00
Daniel Hofstetter
f62b8d7975 csplit: allow offset without sign in pattern 2024-12-27 16:08:48 +01:00
Daniel Hofstetter
db37c316af csplit: add support for -q 2024-12-26 09:40:55 +01:00
Ben Wiederhake
27fd3e5d39 csplit: do not emit remainder of input after an error 2024-03-23 23:21:53 +01:00
Ben Wiederhake
44fa2e960a csplit: correctly handle repeated arguments 2024-03-23 23:21:53 +01:00
Sylvestre Ledru
b49fbd9a21 csplit: run the file check before the arguments verifications 2024-03-17 19:09:34 +01:00
Sylvestre Ledru
8551c55ab3 csplit: adjust the error message to match GNU's
Should fix tests/csplit/csplit
2024-03-16 22:21:44 +01:00
Terts Diepraam
fc82360f58 csplit: fix up tests and error message for filenames 2024-02-16 11:51:04 +01:00
Terts Diepraam
3a21d27c1e uucore/format: ignore the 0 flag if a precision is specified 2024-02-10 12:22:11 +01:00
Terts Diepraam
5fbbfc75de csplit: add test for precision syntax 2024-02-10 11:59:41 +01:00
Sylvestre Ledru
bfca6bf70f Add license headers on all files 2023-08-21 10:49:27 +02:00
Daniel Hofstetter
6988eb7ec6 tests: expand wildcard imports 2023-03-20 15:32:35 +01:00
Daniel Hofstetter
f6b646e4e5 clippy: fix warnings introduced with Rust 1.67.0 2023-01-27 17:37:56 +01:00
Joining7943
1fadeb43b2 tests/util: Do not trim stderr in CmdResult::stderr_is. Add method stderr_trimmed_is.
Fix tests assert whitespace instead of trimming it. Disable some tests in `test_tr` because `tr`
produces too many newlines.
2023-01-22 14:56:19 +01:00
Terts Diepraam
9177cb7b24 all: add tests for usage error exit code 2022-09-10 20:59:42 +02:00
Roy Ivy III
4e20dedf58 tests ~ refactor/polish spelling (comments, names, and exceptions) 2021-05-31 08:23:57 -05:00
Yağız can Değirmenci
071899d24d tests: delete 'error:' prefix from the tests 2021-05-26 02:45:53 +03:00
Stéphane Campinas
89bf7a726e csplit: refresh of the previous PR 2020-12-28 17:21:29 +01:00