Commit graph

10279 commits

Author SHA1 Message Date
Jed Denlea
e5b46ea3eb wc: more tests and fixes
My previous commits meant to bring our wc's output and behavior in line
with GNU's. There should be tests that check for these changes!

I found a stupid bug in my own changes, I was not adding 1 to the
indexes produced by .enumerate() when printing errors.
2023-05-22 01:02:35 -07:00
Jed Denlea
c4b53a44b5 wc: make --files0-from work with streams 2023-05-21 23:59:32 -07:00
Jed Denlea
d58ee5a28a wc: skip String to measure number length
Sadly ilog10 isn't available until we use 1.67, but we can get close in
the meantime.
2023-05-20 23:29:48 -07:00
Jed Denlea
36b45e2249 wc: touch up errors, quote more like GNU
WcError should not hold Strings which are clones of `&'static str`s.
thiserror provides a convenient API to declare errors with their Display
messages.

wc quotes the --files0-from source slightly differently when reporting
errors about empty file names.
2023-05-20 23:29:48 -07:00
Jed Denlea
38b4825e7f wc: avoid excess String allocations
print_stats will now take advantage of the buffer built into
io::stdout().

We can also waste fewer lines on show! by making a helper macro.
2023-05-20 23:08:26 -07:00
Jed Denlea
c3b06e10a6 wc: clean up of settings
The Settings object did not need a QuotingStyle member, it was basically
a static.
2023-05-20 22:30:14 -07:00
Daniel Hofstetter
70765eea82
Merge pull request #4872 from Ideflop/more_implement_print_over_and_clean_print
more: add arguments print over and clean print
2023-05-20 15:32:50 +02:00
Ideflop
2d1a9f6709 fix behavior of -c and -p commands 2023-05-20 08:56:50 +02:00
Sylvestre Ledru
bf1bc1764f
Merge pull request #4877 from cakebaker/mktemp_test_refactorings
mktemp: two small test refactorings
2023-05-19 12:16:07 +02:00
Daniel Hofstetter
a01dc20c30 mktemp: remove TEST_TEMPLATE9 2023-05-19 10:42:52 +02:00
Daniel Hofstetter
5be5f85043 mktemp: simplify test_default_missing_value() 2023-05-19 10:38:04 +02:00
Sylvestre Ledru
fdf8ce548a
Merge pull request #4873 from cakebaker/more_page_down_page_up
more: support PageDown/PageUp keys
2023-05-18 18:24:19 +02:00
Daniel Hofstetter
932f44d3dc more: support PageDown/PageUp keys 2023-05-18 15:24:49 +02:00
Daniel Hofstetter
74e73bee06
Merge pull request #4832 from sylvestre/issue_4821
mktemp -t foo.XXXX should create in TMPDIR
2023-05-18 14:12:40 +02:00
Sylvestre Ledru
cd189b2391 Fix mktemp -t -p ~/projects/playground foo.XXXX 2023-05-18 11:08:55 +02:00
Sylvestre Ledru
35b5fd6a40 mktemp -t foo.XXXX should create in TMPDIR 2023-05-18 11:08:55 +02:00
Ideflop
1a12ffaa79 Add check for terminal in test_valid_arg() function 2023-05-18 09:18:33 +02:00
Daniel Hofstetter
b75688bf79
Merge pull request #4871 from jeddenlea/rm
rm: support non-UTF-8 paths
2023-05-18 08:55:31 +02:00
Jed Denlea
db5696f64b rm: support non-UTF-8 paths
Addresses #4868.
2023-05-17 23:01:21 -07:00
Ideflop
1ce52903b0
Merge branch 'uutils:main' into more_implement_print_over_and_clean_print 2023-05-17 22:47:07 +02:00
Ideflop
b676875c0c more: add arguments print over and clean print 2023-05-17 20:38:03 +02:00
Daniel Hofstetter
d458f3e594
Merge pull request #4864 from sylvestre/why-skip
Document why tests are skipped
2023-05-16 17:04:33 +02:00
Daniel Hofstetter
5b715b4085
Add "spell-checker:ignore" line 2023-05-16 16:10:18 +02:00
Daniel Hofstetter
1e621cb935
Merge pull request #4866 from uutils/renovate/sm3-0.x
chore(deps): update rust crate sm3 to 0.4.2
2023-05-16 14:52:57 +02:00
renovate[bot]
11b72d3849
chore(deps): update rust crate sm3 to 0.4.2 2023-05-16 11:30:17 +00:00
Sylvestre Ledru
a3e455ea3d
Merge pull request #4865 from uutils/renovate/zip-0.x
chore(deps): update rust crate zip to 0.6.6
2023-05-16 13:27:40 +02:00
renovate[bot]
354cb0341c
chore(deps): update rust crate zip to 0.6.6 2023-05-16 10:35:39 +00:00
Sylvestre Ledru
f26bf98883
Merge pull request #4862 from jeddenlea/yes
yes: support non-UTF-8 args
2023-05-16 08:38:43 +02:00
Daniel Hofstetter
21b9cf8e8a
Merge pull request #4863 from sylvestre/split
remaining-gnu-error.py: split SKIP & ERROR
2023-05-16 08:14:47 +02:00
Sylvestre Ledru
6c1552cc20 Document why tests are skipped 2023-05-15 23:20:19 +02:00
Sylvestre Ledru
a1a136650b remaining-gnu-error.py: split SKIP & ERROR 2023-05-15 21:46:07 +02:00
Sylvestre Ledru
137fb4b0b5
Merge pull request #4771 from Joining7943/ci-improve-setup-steps-use-github-actions
`ci`: Improve and speed up setup steps using github actions
2023-05-15 20:45:27 +02:00
Sylvestre Ledru
d07630e1d1
Merge pull request #4766 from Joining7943/ci-fix-gnu-tests-caching
`ci/gnu tests`: fix Swatinem/rust-cache to use correct workspace
2023-05-15 20:40:23 +02:00
Jed Denlea
3870ee252a yes: support non-UTF-8 args
Also, tighten the creation of the output buffer.  Rather than copy "y\n"
8192 times, or any other input some number of times, it can be doubled
in place using Vec::extend_from_within.
2023-05-15 11:29:14 -07:00
Sylvestre Ledru
caaf25a003
Merge pull request #4861 from sylvestre/ls-invalid-utf8
ls: when facing an invalid utf-8, don't panic
2023-05-15 11:08:15 +02:00
Joining7943
a569f6167e ci/gnu tests: Fix Swatinem/rust-cache action to use the correct workspace 2023-05-15 10:51:02 +02:00
Joining7943
4b243ba272 ci: Cleanup enviroment variables which are already set by github actions 2023-05-15 10:48:53 +02:00
Joining7943
2935e5d8f9 ci: Use dtolnay/rust-toolchain to install the toolchain instead of the manual setup 2023-05-15 10:48:53 +02:00
Joining7943
e6f999a32f ci: Install pre-built binaries instead of using cargo install 2023-05-15 10:48:53 +02:00
Sylvestre Ledru
369a2a6631
Simplify the declaration
Co-authored-by: Daniel Hofstetter <daniel.hofstetter@42dh.com>
2023-05-15 10:12:28 +02:00
Sylvestre Ledru
3e7594632b ls: when facing an invalid utf-8, don't panic
Fails with
```
thread 'main' panicked at 'called `Result::unwrap()` on an `Err` value: "invalid-\xE0-"', src/uu/ls/src/ls.rs:1932:53
```
2023-05-14 22:11:44 +02:00
Sylvestre Ledru
49c16a2f11
Merge pull request #4860 from cakebaker/cksum_implement_untagged
cksum: implement --untagged
2023-05-14 19:42:53 +02:00
Daniel Hofstetter
690fff2fc9 cksum: implement --untagged 2023-05-14 16:43:14 +02:00
Sylvestre Ledru
24e0bef781
Merge pull request #4859 from shinhs0506/cp-perm
cp: preserve permissions on -r -p --parents
2023-05-14 10:28:12 +02:00
John Shin
a817186e10 cp: preserve permissions on -r -p --parents 2023-05-12 11:34:51 -07:00
Daniel Hofstetter
1d0b3553c0
Merge pull request #4858 from uutils/renovate/humantime_to_duration-0.x
chore(deps): update rust crate humantime_to_duration to 0.2.1
2023-05-12 17:47:26 +02:00
renovate[bot]
9415c6c8cc
chore(deps): update rust crate humantime_to_duration to 0.2.1 2023-05-12 14:50:22 +00:00
Sylvestre Ledru
64c49de0cc
Merge pull request #4432 from jfinkels/dd-nocache
dd: support the [io]flag=nocache option
2023-05-12 09:53:57 +02:00
Daniel Hofstetter
98fa941250
Merge pull request #4759 from sylvestre/clippy4
fix some clippy warnings in tests
2023-05-12 07:15:44 +02:00
Sylvestre Ledru
2b2215532f
Merge pull request #4857 from uutils/renovate/humantime_to_duration-0.x
chore(deps): update rust crate humantime_to_duration to 0.2.0
2023-05-11 19:57:21 +02:00