Sylvestre Ledru
e5419ade96
Merge pull request #4878 from cakebaker/mktemp_4874
...
mktemp: prioritize TMPDIR over -p when using -t
2023-05-22 09:31:11 +02:00
Jed Denlea
c4b53a44b5
wc: make --files0-from work with streams
2023-05-21 23:59:32 -07:00
Sylvestre Ledru
c91520768e
Merge pull request #4876 from shinhs0506/mkdir-p
...
mkdir: set correct permissions on dirs created by -p
2023-05-22 07:43:52 +02:00
John Shin
33ac653ce5
mkdir: correctly set umask so that tests fail without the fix
2023-05-21 21:07:00 -07:00
Moïse Valvassori
0130a07579
chown: show message if file doesn't exist
...
* print the message "failed to change ownership of" when we try to change a non existing file.
* replace the 4-tuple returned by parse_gid_uid_and_filter by GidUidOwnerFilter struct.
* chain the test in one expression.
* chown: remove unused var "result" in test
---------
Co-authored-by: Daniel Hofstetter <daniel.hofstetter@42dh.com>
2023-05-21 17:54:32 +02: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
Daniel Hofstetter
e844bdfebe
more: remove empty "else"-branches in tests
2023-05-20 16:26:11 +02: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
Daniel Hofstetter
698fafad68
mktemp: prioritize TMPDIR over -p when using -t
2023-05-20 08:02:37 +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
John Shin
f592dff46a
mkdir: skip setting dir permissions on windows
2023-05-18 19:34:57 -07:00
John Shin
5e1a6c1f13
mkdir: add test for checking mode of parent dirs with -p
2023-05-18 19:12:38 -07: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
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
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
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
Daniel Hofstetter
690fff2fc9
cksum: implement --untagged
2023-05-14 16:43:14 +02:00
John Shin
a817186e10
cp: preserve permissions on -r -p --parents
2023-05-12 11:34:51 -07: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
d98293bdaa
bring back the empty line
2023-05-11 18:20:28 +02:00
Sylvestre Ledru
536d12d20d
simplify code
...
Co-authored-by: Daniel Hofstetter <daniel.hofstetter@42dh.com>
2023-05-11 18:19:49 +02:00
Sylvestre Ledru
22a7f98a47
Merge pull request #4856 from cakebaker/cksum_fix_algorithm_output
...
cksum: fix output of --algorithm
2023-05-11 18:18:24 +02:00
John Shin
7a31d841ba
cp: preserve permission on -p --parents ( #4853 )
2023-05-11 16:44:23 +02:00
Daniel Hofstetter
0781ad0a65
cksum: fix output of --algorithm
...
for the algorithms md5, sha[1,224,256,384,512], blake2b, and sm3 from
<digest> <filesize> <filename>
to
<algo name> (<filename>) = <digest>
to use the same format as GNU cksum
2023-05-11 14:24:43 +02:00
SteveLauC
452be5a220
ls: device number for BSDs and solarishOS ( #4841 )
2023-05-11 12:58:36 +02:00
leone
d8f1f1c16c
date: bugfix test_date_for_no_permission_file ( #4544 )
2023-05-10 18:40:58 +02:00
Daniel Hofstetter
ba6eb392aa
cksum: split test function into two
2023-05-10 09:48:32 +02:00
Daniel Hofstetter
d769871374
Merge pull request #4831 from sylvestre/mv-hardlink
...
mv: 'mv source hardlink' should fail
2023-05-08 16:12:23 +02:00
Sylvestre Ledru
48b8cfa595
mv: adjust the tests - duplicate code + android
...
According to:
https://stackoverflow.com/questions/44913985/creating-hardlinks-and-symlinks-in-android
hardlink aren't expected to work on android + fat
2023-05-08 15:24:47 +02:00
Sylvestre Ledru
594f81a88a
mv --backup=simple a b on hard links should not fail
...
touch a
ln a b
./target/debug/coreutils mv --backup=simple a b
GNU: tests/mv/hard-4.sh
2023-05-08 13:08:20 +02:00
Daniel Hofstetter
560ac3d6fb
dd: fix "unused imports" warning in tests
2023-05-08 07:59:56 +02:00
Sylvestre Ledru
a5a39b6ba8
mv: 'mv source hardlink' should fail
...
fixes: tests/mv/force.sh
2023-05-07 23:08:41 +02:00
Jeffrey Finkelstein
4ff318aee1
fixup! dd: support the [io]flag=nocache option
2023-05-07 16:33:21 -04:00
Jeffrey Finkelstein
bd18a2a344
dd: support the [io]flag=nocache option
...
Add support for the `iflag=nocache` and `oflag=nocache` to make `dd`
discard the filesystem cache for the processed portion of the input or
output file.
2023-05-07 11:43:13 -04:00
Sylvestre Ledru
b94d10f080
Fix some semicolon_if_nothing_returned
2023-05-06 19:35:44 +02:00
Daniel Hofstetter
93c8623da9
mv: if more than one of -i, -n, -f, latest "wins"
2023-05-05 15:17:37 +02:00
Daniel Hofstetter
4ee1118061
Merge pull request #4823 from shinhs0506/mv-i-dir-file
...
fix tests/mv/i-5.sh
2023-05-04 13:43:05 +02:00
John Shin
84567336a8
mv: update test case so it doesn't fail
2023-05-03 23:54:28 -07:00
Daniel Hofstetter
616a166e36
Merge pull request #4820 from sylvestre/thru-dangling-2
...
cp: fix cp -f f loop when loop is a symlink loop
2023-05-04 08:20:57 +02:00
John Shin
1c8aac0883
mv: return err if response is negative when moving a dir to existing dest during an interactive mode
2023-05-03 16:05:21 -07:00
Sylvestre Ledru
832fd2d2c6
cp: fix cp -f f loop when loop is a symlink loop
...
Fix: tests/cp/thru-dangling.sh
2023-05-03 19:54:35 +02:00
Daniel Hofstetter
a97199f72a
Merge pull request #4796 from shinhs0506/mv-cp-update
...
mv, cp: add support for --update=none,all,older
2023-05-03 15:21:21 +02:00
Daniel Hofstetter
923a62c6be
mv: fix function/file names in tests
2023-05-03 10:07:46 +02:00
Daniel Hofstetter
82eb04c5a9
Merge pull request #4777 from Joining7943/tail-change-text-static-to-const
...
'tail': Change static global variables to const
2023-05-03 09:31:34 +02:00
Sylvestre Ledru
aae3f2f99c
Ride along: fix some trivial clippy warnings
2023-05-02 23:22:39 +02:00
John Shin
8ad2fa3cc1
mv: write test for multiple update args
2023-05-02 13:46:43 -07:00
John Shin
918c36b485
cp: write test for multiple update args
2023-05-02 13:46:08 -07:00
John Shin
983fee0cea
cp: fix wrong test names for update
2023-05-02 13:35:52 -07:00
John Shin
c0e4e4f757
cp: simplify tests for update
2023-05-02 13:35:06 -07:00
John Shin
6a100976c7
mv: simplify tests for update
2023-05-02 13:30:38 -07:00
Sylvestre Ledru
e166d90db8
Merge pull request #4813 from cakebaker/bump_fundu_to_0_5_1_and_fix_tests
...
Bump fundu to 0.5.1 and fix tests
2023-05-02 12:09:48 +02:00
Daniel Hofstetter
3f8e21c36c
Merge pull request #4812 from sylvestre/thru-dangling
...
cp: add support POSIXLY_CORRECT=1 when dealing with dangling links
2023-05-02 10:00:18 +02:00
Daniel Hofstetter
ad37db8da3
sleep: fix broken tests due to fundu update
2023-05-01 14:25:59 +02:00
John Shin
66a9169e55
cp: fix typos
2023-05-01 03:54:56 -07:00
Sylvestre Ledru
2d4dfc3d7d
cp: add support POSIXLY_CORRECT=1 when dealing with dangling links
...
GNU: tests/cp/thru-dangling.sh
2023-05-01 11:05:00 +02:00
John Shin
85ded232bc
mv: resolve merge conflict
2023-04-30 20:09:32 -07:00
John Shin
78412c5a61
mv: add tests for --update
2023-04-30 19:29:49 -07:00
John Shin
ed3ff10540
cp: write tests for --update
2023-04-30 19:29:49 -07:00
Sylvestre Ledru
75e33695e5
Disable test_gnu_options on android
2023-04-30 20:08:06 +02:00
Sylvestre Ledru
9dff7d86cb
Disable test_factor::test_parallel on android
2023-04-29 21:29:47 +02:00
Sylvestre Ledru
53ae5c33c9
Disable test_sort::test_compress_fail (for real) & test_cp::test_cp_arg_interactive_update on android
2023-04-29 20:39:18 +02:00
Sylvestre Ledru
ac068e0487
Disable test_sort::test_compress_fail & test_chmod::test_mode_after_dash_dash on android
2023-04-29 19:23:56 +02:00
Sylvestre Ledru
4e712140fe
Do not run test_closes_file_descriptors on android
...
Closes : #4736
2023-04-29 18:48:15 +02:00
Sylvestre Ledru
c5fb6eac9f
Merge pull request #4794 from shinhs0506/mv-target-dir
...
mv: check if --target is a directory
2023-04-29 10:40:44 +02:00
Daniel Hofstetter
736a00a85f
paste: ignore failing test on Windows
2023-04-28 15:08:01 +02:00
Daniel Hofstetter
c254900db9
paste: handle list ending with unescaped backslash
2023-04-28 14:33:53 +02:00
John Shin
a93bccb5b9
mv: add tests for --target
2023-04-28 03:10:10 -07:00
Niyaz Nigmatullin
467cbf30de
[tests/ls] Support user names containing dots
...
- Fix regex's in tests for `ls -l`
2023-04-27 18:27:48 +03:00
Sylvestre Ledru
474d391eb1
Merge pull request #4790 from sylvestre/date_use_humantime_to_duration
...
date -d supports - 1 year ago, 2 second, etc
2023-04-26 23:54:49 +02:00
Sylvestre Ledru
360cbda0c5
Merge pull request #4782 from cakebaker/mv_no_clobber_behavior_change
...
mv: adapt -n behavior to GNU mv 9.3
2023-04-26 22:47:12 +02:00
Sylvestre Ledru
5a7eb5b3a3
Merge pull request #4783 from sunfishcode/sunfishcode/default-nice
...
Avoid spurious failures in the presence of non-zero default nice
2023-04-26 22:46:37 +02:00
Sylvestre Ledru
686ad2d6d2
Merge pull request #4784 from sunfishcode/sunfishcode/ls-order-time
...
Use `expected_result` in test_ls to avoid spurious failures
2023-04-26 22:46:06 +02:00
Sylvestre Ledru
825d240ef0
date -d supports - 1 year ago, 2 second, etc
2023-04-26 22:14:15 +02:00
Sylvestre Ledru
0f268428fe
Merge pull request #4379 from ZauJulio/hotfix-mktemp
...
mktemp: fix PrefixContainsDirSeparator verification
2023-04-26 18:28:56 +02:00
John Shin
d4630c83b4
mv: add 'renamed ' in the beginning when verbose flag is set
2023-04-25 21:27:52 -07:00
Dan Gohman
12686c478e
Avoid spurious failures in the presence of non-zero default nice
...
Make `test_get_current_niceness` query the libc nice value instead of
hard-coding a value of zero. This avoids a spurious failure on systems
which have a non-zero default nice value.
This fixes spurious failures on my machine.
2023-04-25 14:39:37 -07:00
Dan Gohman
eba000ddcc
Use expected_result
in test_ls to avoid spurious failures
...
As the existing comment says, the expected output here is dependent on
the platform, so use the `expected_result` utility to avoid hard-coding
specific results for each platform.
This fixes spurious failures on my machine.
2023-04-25 05:40:37 -07:00
Daniel Hofstetter
804274dbf4
mv: adapt -n behavior to GNU mv 9.3
2023-04-25 11:33:48 +02:00
Sylvestre Ledru
6115af6386
Merge pull request #4769 from sylvestre/touch
...
touch: improve support for dangling link
2023-04-25 08:26:23 +02:00
Sylvestre Ledru
d1aa1ac963
Use the humantime_to_duration crate
2023-04-24 22:23:07 +02:00
Sylvestre Ledru
84e0610487
touch: don't generate an error on 'touch -h -'
2023-04-24 12:03:21 +02:00
Sylvestre Ledru
aaea758b6a
touch: -h should not fail when running on broken symlink
...
Fixes more of tests/touch/no-dereference.sh
2023-04-24 12:03:21 +02:00
Sylvestre Ledru
c3656e561c
touch: -h -r should not fail when running on broken symlink
...
Fixes the beginning of:
tests/touch/no-dereference.sh
2023-04-24 12:03:21 +02:00
Joining7943
c6f6c87780
tests/tail: Change static global variables to const
2023-04-23 23:11:40 +02:00
Daniel Hofstetter
e94f1d8eb7
mv: -i show no error if overwriting is declined
2023-04-23 15:27:24 +02:00
Joining7943
ae60045f3f
tail: Fix printed header for stdin should be the same on all platforms
2023-04-21 21:55:28 +02:00
Daniel Hofstetter
7730c8171d
du: fix clippy warning in test
2023-04-21 17:01:40 +02:00
Sylvestre Ledru
efa361dd7c
Fix some trivial clippy warnings
2023-04-20 23:22:05 +02:00
Sylvestre Ledru
47e61f064c
Fix a comment in the rustdoc
2023-04-20 23:22:05 +02:00
Sylvestre Ledru
ab22f49feb
Merge pull request #4753 from cakebaker/fmt_cleanup_tests
...
fmt: cleanup tests
2023-04-20 17:55:55 +02:00
Daniel Hofstetter
72041568e7
fmt: cleanup tests
2023-04-20 15:22:26 +02:00
Terts Diepraam
d68fd68b5f
Merge pull request #4734 from Joining7943/tail-fix-args-parsing-follow-mode
...
tail/args: Fix parsing when -F is used together with --retry or --follow
2023-04-20 09:43:24 +02:00
Joining7943
20e32971dd
tail/args: Fix parsing when -F is used together with --retry or --follow
2023-04-18 21:47:20 +02:00
Ideflop
6a54d820ac
factor: add -h/--exponents option ( #4710 )
...
* factor: add -h/--exponents option
* Factor: Rebase, add -h/--exponents options
2023-04-14 21:20:19 +02:00
Sylvestre Ledru
47cb40c020
du: adjust test_du_basics_bad_name as we made it work
2023-04-13 13:27:04 +02:00
Sylvestre Ledru
eea8d40e78
du: add support of --dereference-args
...
Should fix tests/du/deref.sh
2023-04-13 13:27:04 +02:00
Sylvestre Ledru
5a1d9cec7e
du: an error code when done on a non existing file
2023-04-13 13:27:04 +02:00
Daniel Hofstetter
dd3c0f7fe9
Merge pull request #4729 from spineki/b2sum-missing-l-option
...
B2sum: add -l/--length option
2023-04-13 09:57:55 +02:00
Marras Antoine
756293a9c4
b2sum: added tests to handle 0, non multiple of 8 and and more than 512 cases
2023-04-12 21:05:11 +02:00
Marras Antoine
0798cfe155
b2sum: added test for length option
2023-04-10 20:27:49 +02:00
Daniel Hofstetter
7a888da409
tests: remove all "extern crate" statements
2023-04-10 08:31:31 +02:00
Daniel Hofstetter
81b1bc1fa7
touch: remove unnecessary "extern crate"s
2023-04-08 16:34:29 +02:00
xalfer
19e456fe2a
touch: add support for --ref and --date together
...
This commit resolves issue #4608 .
To make it relatively straightforward to implement I have taken some
code from parse_date and put it inside a function parse_relative_time.
This commit changes and adds some test as well to work with the new
functionality.
2023-04-07 21:36:26 +02:00
Daniel Hofstetter
305087f8e2
factor: remove unnecessary "extern crate" in test
2023-04-06 14:52:54 +02:00
Daniel Hofstetter
74a95bc7a5
factor: expand glob import in test
2023-04-06 09:47:21 +02:00
Daniel Hofstetter
20a8b5ac9e
factor: fix "unused import" warning in test
2023-04-06 09:45:13 +02:00
Terts Diepraam
f82f92ec9f
Merge pull request #4672 from sylvestre/dircolors
...
dircolors: trigger an error when used on /
2023-04-05 00:01:19 +02:00
Daniel Hofstetter
b8eb9d3552
wc: use concat! to improve readability of tests
2023-04-04 16:36:49 +02:00
Daniel Hofstetter
0fa08757fa
wc: implement --total
2023-03-31 08:16:46 +02:00
Surya Teja K
b14d19770f
date: show error when reading dirs for -f arg ( #4572 )
...
Co-authored-by: Sylvestre Ledru <sylvestre@debian.org>
2023-03-29 07:49:14 +02:00
0xMRTT
e7ef9dcd46
hashsum
: add --zero
option (#4612 ) ( #4632 )
...
* `hashsum`: add `--zero` option (#4612 )
2023-03-28 23:26:11 +02:00
Sylvestre Ledru
d29f9f2e30
dircolors: trigger an error when used on /
2023-03-28 22:54:16 +02:00
Sylvestre Ledru
6a69894f60
Merge pull request #4297 from jfinkels/mktemp-uncomment-fixed-test
...
mktemp: uncomment fixed test case
2023-03-27 21:11:29 +02:00
Daniel Hofstetter
089e645e3b
Merge pull request #4637 from haciek/du_threshold_err_fix
...
du: threshold error message fix
2023-03-27 16:32:30 +02:00
Maciej Habasiński
d277603bf1
du: fmt fix
2023-03-26 23:38:31 +02:00
Terts Diepraam
74b54074e1
deps: bump time
from 0.3.17 to 0.3.20 ( #4643 )
2023-03-26 21:47:12 +02:00
Sylvestre Ledru
ef601fac98
Merge pull request #4630 from sylvestre/inter-error
...
Adjust -i behavior for ln, cp & mv
2023-03-26 15:35:24 +02:00
Maciej Habasiński
892f1d910a
test: du invalid threshold
2023-03-26 15:08:56 +02:00
Daniel Hofstetter
f96f2fae5b
tests: fix unused import "rstest::rstest" warning
2023-03-26 11:53:20 +02:00
leon3s
bf94e8fff1
test: refactor error handling with ParseError enum
2023-03-25 14:03:45 +01:00
Sylvestre Ledru
9d54ed02a8
ln -i: adjust the behavior to match the GNU change
...
Just like mv & cp
Matches the change upstream
7a69df88999bedd8e9fccf9f3dfa9ac6907fab66
2023-03-25 11:22:45 +01:00
Sylvestre Ledru
d0a4059f34
cp -i: adjust the behavior to match the GNU change
...
Just like mv
Note that cp -i -u won't show the overwrite question
Matches the change upstream
7a69df88999bedd8e9fccf9f3dfa9ac6907fab66
2023-03-25 11:22:45 +01:00
Sylvestre Ledru
0d5daacf99
mv -i: adjust the behavior to match the GNU change
...
Matches the change upstream
7a69df88999bedd8e9fccf9f3dfa9ac6907fab66
2023-03-25 11:22:45 +01:00
Sylvestre Ledru
a4a290caf2
Merge branch 'main' into default-env-for-tests
2023-03-24 20:33:34 +01:00
Miles Liu
81a4e8fb7d
Remove keep_env
from the test framework
2023-03-24 14:25:37 +08:00
Terts Diepraam
c8ece3e972
test_touch: test a specific time with DST problems
...
Use a specific time to check whether any DST problems arise. The test is
also ignored, because this functionality seems to be broken at the
moment. Still, this is an improvement, because it is more reliable and
does not need to obtain a local offset, which might lead to a panic in
the time library.
2023-03-23 18:16:57 +01:00
Terts Diepraam
4dd88680eb
tests: define default env vars for test commands
...
We now run each command with TZ=UTC and LC_ALL=C to ensure consistent
behavior independent from external timezone and locale settings. These
can still be overridden with other values if necessary.
2023-03-23 18:15:05 +01:00
Daniel Hofstetter
74d8f2fae8
Merge pull request #4578 from daviddwk/fix-util-unnecessary-boolean-not
...
util: fix unnecessary boolean not operations
2023-03-23 10:41:47 +01:00
Piotr Kwiecinski
51d39c8bb7
test_ls: cannot find function expected_result
in this scope
2023-03-23 09:18:17 +01:00
daviddwk
c24194f454
util: fix unnecessary boolean not operations
2023-03-22 17:13:50 +01:00
Sylvestre Ledru
0f497660c8
Merge pull request #4577 from cakebaker/clippy_fix_long_literal_lacking_separators
...
touch: add underscores to long number in test
2023-03-22 16:59:20 +01:00
Daniel Hofstetter
c95bf0a116
touch: add underscores to long number in test
2023-03-22 16:48:53 +01:00
Miles Liu
2bcdae124c
chroot: fix unused import on Android
2023-03-22 12:02:01 +08:00
Daniel Hofstetter
0140f4f7d0
tests: fix "unresolved import" warnings on Windows
2023-03-20 16:26:31 +01:00
Daniel Hofstetter
94aeba9854
tests: fix unused imports warnings on Windows
2023-03-20 16:06:56 +01:00
Daniel Hofstetter
6988eb7ec6
tests: expand wildcard imports
2023-03-20 15:32:35 +01:00
Terts Diepraam
b8f2f295a6
Merge pull request #4498 from jfinkels/dd-seconds-precision-3
...
dd: fix precision for display of total time spent
2023-03-20 12:52:48 +01:00
Sylvestre Ledru
c611176878
Merge pull request #4546 from leon3s/fix-test-sort-literal-lacking-separator
...
fix: clippy long literal lacking separators
2023-03-19 19:45:12 +01:00
jfinkels
59d34ce667
Merge branch 'main' into dd-seconds-precision-3
2023-03-19 13:29:14 -04:00
Jeffrey Finkelstein
1de1a84ed2
mktemp: uncomment fixed test case
...
Uncomment a test case fixed by commit
53c4b0b81e
(pull request
https://github.com/uutils/coreutils/pull/4091 ).
2023-03-19 13:20:10 -04:00
leon3s
be51f9aa5b
fix: clippy long literal lacking separators
2023-03-19 15:01:59 +01:00
Sylvestre Ledru
10b4aeb2c8
Merge pull request #4548 from papparapa/test-du-clippy-if-not-else
...
test_du: fix unnecessary boolean operation
2023-03-19 08:56:57 +01:00
Surya Teja K
b39c4d2756
date: fix invalid argument error for RFC 3339 ( #4535 )
2023-03-19 08:54:45 +01:00
Koki Ueha
0b042f0b32
test_du: fix unnecessary boolean operation
2023-03-19 04:59:08 +00:00
leon3s
6de67cfc36
sort: fix test clippy long literal lacking separators
2023-03-18 22:30:48 +01:00
Sylvestre Ledru
be6d5bfb9c
Fix some redundant closure in test_shurf
2023-03-18 15:52:13 +01:00
Sylvestre Ledru
d42b4883e1
Fix some simply clippy warnings
...
With:
`cargo +nightly clippy --features unix --allow-dirty --fix -- -W clippy::pedantic`
2023-03-18 14:36:49 +01:00
august radjoe
89b83c2f6a
A better handler for ./coreutils date -f aze
( #4482 )
2023-03-18 14:19:57 +01:00
Daniel Hofstetter
882a35c3b6
Merge pull request #4526 from tertsdiepraam/date-d-should-return-1
...
`date`: make sure 'invalid date' message also returns exit code 1
2023-03-18 07:08:04 +01:00
Terts Diepraam
e3aab307fe
Merge pull request #4189 from jfinkels/dd-stdin-from-file-descriptor
...
dd: open stdin from file descriptor when possible
2023-03-18 01:30:31 +01:00
Terts Diepraam
1b1446ce0c
date: make sure 'invalid date' message also returns exit code 1
2023-03-17 21:49:26 +01:00
jparag
7ea63d0b59
Merge branch 'main' into test_ls_fix
2023-03-17 10:58:58 -04:00
Terts Diepraam
2a4b48f253
Merge pull request #4442 from bbara/chmod-usage
...
chmod: fix GNU test 'chmod/usage'
2023-03-17 15:18:39 +01:00
Daniel Hofstetter
0d9d9118ad
Merge pull request #4523 from miles170/test-shred-force
...
shred: enable `test_shred_force` on FreeBSD
2023-03-17 09:29:08 +01:00
Miles Liu
ab9d1030ff
shred: enable test_shred_force
on FreeBSD
2023-03-17 14:37:15 +08:00
Anish Bhobe
624588d37f
date: Added default value for date --i
.
...
`default_missing_value` set to `OPT_DATE` (`"date"`)
`num_args(0..=1)` required for `default_missing_value`.
Using function name `test_date_rfc_8601_default`.
The function name `test_date_rfc_8601` is left intact for
compatibility.
Fixes : #4521
2023-03-17 03:06:31 +01:00
Benjamin Bara
e982d57819
chmod: fix GNU test 'chmod/usage'
2023-03-16 21:25:26 +01:00
Benjamin Bara
787d854f89
chmod: add GNU usage tests
2023-03-16 21:16:51 +01:00
Sylvestre Ledru
5298ba8250
Merge pull request #4520 from kidrigger/wip-date-test
...
tests/date: Added tests for date ISO8601 formats.
2023-03-16 20:53:01 +01:00
Surya Teja K
bd6905cf59
fix: match date -I error messages with GNU date ( #4499 )
...
* date: use value_parser to improve errors
* date: update panic! to unreachable inside impl From for Iso8601Format
2023-03-16 20:50:37 +01:00
Anish Bhobe
ac23dca426
tests/date: Added tests for date ISO8601 formats.
...
Regex matching for correctness check.
Tests for format with `minute`, `hour` and `date` added.
2023-03-16 18:14:27 +01:00
Parag Jain
2118e85508
Merge branch 'main' into test_ls_fix
2023-03-15 17:10:54 -04:00
Terts Diepraam
dad474bfa0
Merge pull request #4315 from miles170/issue-4176-fix-timeout
...
timeout: fix subprocess is never terminated
2023-03-15 14:10:58 +01:00
Miles Liu
1435d3573a
dd: fix unused imports on FreeBSD
2023-03-15 18:08:32 +08:00
Parag Jain
50e019a711
Fixing failing test locally because of missing case sensitivity handling
2023-03-14 12:28:49 -04:00
Joining7943
5fb091a4fb
sleep: Use fundu error types to improve error messages
2023-03-12 15:37:44 +01:00
Joining7943
946aab37ed
Cargo: Bump fundu version v0.3.0 -> v0.4.2. Adjust test in test_tail.
2023-03-12 15:37:44 +01:00
Terts Diepraam
9a231be9c5
Merge branch 'main' into dd-seconds-precision-3
2023-03-12 14:14:53 +01:00
Terts Diepraam
7a6092b333
Merge branch 'main' into dd-stdin-from-file-descriptor
2023-03-12 13:56:28 +01:00
Terts Diepraam
320929d83d
Merge branch 'main' into issue-4176-fix-timeout
2023-03-12 13:35:27 +01:00
Jeffrey Finkelstein
2f56536637
dd: fix precision for display of total time spent
...
Improve the display of the total time spent transferring bytes so that
the number of seconds is displayed using the `%g` format specifier as
in `printf`. This matches the behavior of GNU `dd`.
Before this commit, the precision was always set to one digit after
the decimal point. For example,
$ dd count=100000 if=/dev/zero of=/dev/null
100000+0 records in
100000+0 records out
51200000 bytes (51 MB, 49 MiB) copied, 0.2 s, 268.1 MB/s
After this commit, the precision increases dynamically as the duration
decreases. For example,
$ dd count=100000 if=/dev/zero of=/dev/null
100000+0 records in
100000+0 records out
51200000 bytes (51 MB, 49 MiB) copied, 0.1019 s, 507 MB/s
$ dd count=1000 if=/dev/zero of=/dev/null
1000+0 records in
1000+0 records out
512000 bytes (512 kB, 500 KiB) copied, 0.002663 s, 256 MB/s
$ dd count=10 if=/dev/zero of=/dev/null
10+0 records in
10+0 records out
5120 bytes (5.1 kB, 5.0 KiB) copied, 0.000182 s, 5.1 MB/s
2023-03-11 22:37:43 -05:00
Jeffrey Finkelstein
9cb6b4a3c0
dd: open stdin from file descriptor when possible
...
Open stdin using its file descriptor so that a `dd skip=N` command in
a subshell does not consume all bytes from stdin.
For example, before this commit, multiple instances of `dd` reading
from stdin and appearing in a single command line would incorrectly
result in an empty stdin for each instance of `dd` after the first:
$ printf "abcdef\n" | (dd bs=1 skip=3 count=0 && dd) 2> /dev/null
# incorrectly results in no output
After this commit, the `dd skip=3` process reads three bytes from the
file descriptor referring to stdin without draining the remaining
three bytes when it terminates:
$ printf "abcdef\n" | (dd bs=1 skip=3 count=0 && dd) 2> /dev/null
def
2023-03-11 20:56:37 +00:00
Miles Liu
f406b56f4a
timeout: fix subprocess is never terminated
2023-03-10 18:08:54 +08:00
Daniel Hofstetter
3eeb5dda30
tests: adapt to clap's modified error messages
2023-03-09 10:06:20 +01:00
Terts Diepraam
69406e7d52
Merge pull request #4439 from Joining7943/sleep-fix-panic-adding-durations
...
`sleep`: Fix parsing of multiple inputs panics on overflow, some whitespace issues ...
2023-03-07 16:32:43 +01:00
Joining7943
71bbebdc76
sleep: Fix whitespace issues. Don't panic when adding durations.
...
Refactor error propagation and use show_error! instead of USimpleError.
2023-03-07 13:33:49 +01:00
Zaú Júlio
b540b15b5a
Merge branch 'main' into hotfix-mktemp
2023-03-06 21:39:56 -03:00
Sylvestre Ledru
49eb9a2e91
Merge branch 'main' into cp-pathbuf
2023-03-05 16:22:21 +01:00
Zaú Júlio
65b1be9456
Merge branch 'main' into hotfix-mktemp
2023-03-03 14:22:07 -03:00
Sylvestre Ledru
60771b1026
Merge pull request #4446 from eggpi/main
...
tests/du: run test_du_time with TZ=UTC.
2023-03-03 13:22:08 +01:00
Guilherme Gonçalves
d29119728a
tests/du: run test_du_time with TZ=UTC.
...
du --time formats a file's timestamp according to the local timezone,
but the test implicitly assumed UTC. This caused it to fail when
running locally in my UTC+1 machine.
$ cargo test --features "du touch" --no-default-features
Failure: https://gist.github.com/eggpi/651e01559b7c59e9457c1b22fe4c0c19
2023-03-02 22:14:03 +00:00
Zaú Júlio
b41713c106
Merge branch 'main' into hotfix-mktemp
2023-03-02 15:31:39 -03:00
ZauJulio
2cf2460809
Merge branch 'hotfix-mktemp' of github.com:ZauJulio/coreutils into hotfix-mktemp
2023-03-02 15:31:11 -03:00
ZauJulio
b94a0d2ebe
mktemp: fix test fmt
2023-03-02 15:30:55 -03:00
Daniel Hofstetter
a7a55c7433
comm: allow multiple occurrence of -z
2023-03-02 16:18:42 +01:00
Terts Diepraam
b9bca794cc
Merge pull request #4449 from cakebaker/comm_zero_terminated
...
comm: implement --zero-terminated
2023-03-01 22:52:31 +01:00
Zaú Júlio
ddb9b592bf
Merge branch 'main' into hotfix-mktemp
2023-03-01 15:52:24 -03:00
ZauJulio
e9bd69e051
mktemp: fix test_prefix_template_separator adding -p param
2023-03-01 15:45:41 -03:00
Daniel Hofstetter
0d782e09c1
comm: implement --zero-terminated
2023-03-01 16:59:51 +01:00
Benjamin Bara
9b49f368c7
tail: parse default before obsolete
2023-02-28 18:58:12 +01:00
Benjamin Bara
f6edea2d05
tail: enable non-utf8 paths
2023-02-28 18:58:12 +01:00
Benjamin Bara
dc34e89d50
tail: skip clap for obsolete args
2023-02-28 18:58:12 +01:00
Benjamin Bara
b83c30b12e
tail: improve GNU compatibility
2023-02-28 18:58:12 +01:00
ZauJulio
9b4fb0cb6e
mktemp: add tests UNIX and POSIX to check path in prefix
2023-02-28 12:38:18 -03:00
Joining7943
68f75af678
sleep: Fix duration parsing of multiple inputs when duration overflow should saturate and not panic
2023-02-28 08:04:55 +01:00
Zaú Júlio
5c3bb90df2
Merge branch 'main' into hotfix-mktemp
2023-02-27 01:15:36 -03:00
Terts Diepraam
c148215e7d
Merge pull request #3954 from dmatos2012/modify-cp-archive-flag-behavior
...
cp: modify archive flag to copy dir contents rather than dir
2023-02-26 13:24:45 +01:00
Zaú Júlio
be2b7032f6
Merge branch 'main' into hotfix-mktemp
2023-02-25 18:37:22 -03:00
ZauJulio
dc1fd027a6
mktemp: fix fmt of test_prefix_template_separator
2023-02-25 18:35:35 -03:00
David Matos
d9a21ff8f0
chmod: allow verbose and quiet flags to be used more than once
2023-02-23 20:21:38 +01:00
Terts Diepraam
3554565c82
Merge pull request #4356 from howjmay/cksum-a
...
cksum: implement -a
2023-02-23 12:18:21 +01:00
Terts Diepraam
198e948f4a
Merge pull request #4419 from sylvestre/test_invalid_multi_byte_characters
...
timeout: add a test to verify that it fails as expected
2023-02-23 10:41:59 +01:00
Zaú Júlio
59490e4a17
Merge branch 'main' into hotfix-mktemp
2023-02-22 20:23:36 -03:00
ZauJulio
3d2f3fc5b1
mktemp: add test to . in template prefix
2023-02-22 20:22:16 -03:00
Sylvestre Ledru
41018859bb
Merge pull request #4365 from kylemanna/km/fix-install-directory-chown
...
install: add missing directory chown
2023-02-22 21:49:22 +01:00
Sylvestre Ledru
74419366fd
timeout: add a test to verify that it fails as expected
...
Follow up of PR #4388
2023-02-22 21:25:23 +01:00
Terts Diepraam
60d2df56de
Merge pull request #4164 from jfinkels/dd-fifo-seek
...
dd: allow skipping and seeking in FIFOs
2023-02-22 10:38:45 +01:00
Thayne McCombs
17f9507e17
Add tests for non-utf8
2023-02-21 22:58:39 -07:00
Terts Diepraam
6bd42fde6a
Merge pull request #4293 from Joining7943/tests-util-refactor-ucommand-add-run-in-shell
...
`tests/util`: Small Refactor/Fixes of `UCommand` and add method to run a `UCommand` in a shell platform independently
2023-02-21 22:41:20 +01:00
Guilherme A. de Souza
7d7b9eb49a
Migrate from atty
to is-terminal
( #4382 )
2023-02-21 21:52:18 +01:00
David Matos
dd4299c32e
chmod: supress verbose output when not verbose
2023-02-20 22:18:07 +01:00
David Matos
fe4da2b8e5
cp: modify archive flag to copy dir contents rather than dir
2023-02-20 16:49:33 +01:00
Kyle Manna
376f4d90ef
install: add tests for invalid owner and group
...
* Move the user and group resolution to the behavior decoding instead of
re-running on every file/directory creation. Simplifies code.
* Update error output to match GNU coreutils.
* Add tests to verify invalid owner and group.
2023-02-18 22:46:12 -06:00
Kyle Manna
7aa7f219a0
install: fix issue #4360 with bad target directory permissions
...
* Correct bug that set the last directory to the mode the file should
have been set to.
* Add unit test to verify correct functionality.
2023-02-18 22:32:31 -06:00
Joining7943
1c230fd779
tests/util: Refactor UCommand and TestScenario.
...
Summary of changes in UCommand:
* Extend UCommand by builder methods and simplify methods in TestScenario
* Simplify code structures where possible. Add documentation.
* Store bin_path as PathBuf and util_name as String in all structs
* Remove UCommand::util and make bin_path, temp_dir private
* Rename UCommand::with_limit -> UCommand::limit
Summary of changes in TestScenario:
* Rename some parameters in TestScenario methods to be more descriptive
* Remove ucmd_keepenv, cmd_keepenv from TestScenario. Use UCommand::keep_env instead.
2023-02-18 23:38:20 +01:00
Jeffrey Finkelstein
c52647a632
dd: add support for skipping in input FIFO
...
For example, `dd skip=1 if=fifo` will now work.
2023-02-18 21:24:16 +01:00
Jeffrey Finkelstein
9c3f810f97
dd: add support for seeking in output FIFOs
...
For example, `dd seek=1 of=fifo` will now work.
2023-02-18 21:24:16 +01:00
Yang Hau
678a11dcf2
cksum: Implement option -a
...
Implement option -a --algorithm.
Move digest to src/uucore/src/lib/features and rename it to hash.
fix lint
fix Cargo.toml
2023-02-18 20:58:53 +08:00
Joining7943
fdf0f96a01
tests/util: Restructure UCommand to run in shell per default. Introduce constant TESTS_BINARY.
...
Summary of changes in tests/util:
* Introduce global constant TESTS_BINARY holding the path to `coreutils`
* Implement running an arbitrary command in a sh or cmd shell per default.
* Implement std::fmt::Display for UCommand.
* Change usages of UCommand::util_name from &Option<OsStr> to Option<OsStr>
* `UCommand::new_from_tmp`: Use OsStr directly instead of TempDir -> String -> OsStr
* Collect arguments in `UCommand::args` field
* Build environment variables in `UCommand` itself instead of `std::process::Command`
* Move building of std::process:Command from fields in UCommand to own method `build`
* Remove assertions of UCommand::has_run in arg, args and env.
Summary of changes in tests/by-util:
* Remove usages of UCommand::raw. Fix tests to use UCommand::to_string.
* test_test: Adjust test_invalid_utf8_integer_compare to use `UCommand::args`
* test_chmod: run_single_test
* test_pwd: symlinked_env
* test_cp:
Fix the usage of &Option<OsStr> in `test_src_base_dot`
Refactor test_src_base_dot to not use UCommand::new but ts.ucmd() instead
2023-02-17 17:39:33 +01:00
Joining7943
2b5b0c82c1
tests/util: Bump rlimit version to 0.9.1 to be able to use prlimit
on android
2023-02-17 17:39:30 +01:00
Terts Diepraam
9fdce975fd
Merge pull request #4359 from dmatos2012/chmod-multiple-files-error
...
chmod: change permissions for files present even when there is a missing file
2023-02-17 11:27:32 +01:00
David Matos
946c8d2d4a
chmod: change permissions for files present even when there is a missing file
2023-02-16 23:13:06 +01:00
Joining7943
f610f33aa7
tests/util
: Don't trim output in CmdResult::stdout_matches
and stdout_does_not_match
(#4304 )
...
* tests/util: Fix documentation of UCommand::stderr_only and usage_error
* tests/util: Remove trimming from CmdResult::stdout_matches and stdout_does_not_match. Fix tests.
The tests are fixed to match the trailing newline instead of ignoring it.
2023-02-16 15:33:33 +01:00
Terts Diepraam
ff5000d4d0
Merge pull request #4239 from Joining7943/tail-fix-parsing-of-sleep-interval
...
`tail`: fix argument parsing of sleep interval
2023-02-16 15:14:53 +01:00
Sylvestre Ledru
d3fc0e8706
Merge pull request #4314 from cakebaker/comm_total_with_output_delimiter
...
comm: use delimiter on "total" line
2023-02-16 14:24:02 +01:00
Terts Diepraam
df7fe29095
Merge pull request #4339 from howjmay/tr-newline
...
tr: Remove the extra newline in stderr
2023-02-14 22:58:40 +01:00
Yang Hau
ec81a23afc
tr: Remove the extra newline in stderr
...
closes #4301
2023-02-15 02:04:43 +08:00
Joining7943
3a613cbc7f
tests/util: Fix path resolution of test executable
2023-02-14 11:22:49 +01:00
Jeffrey Finkelstein
c6d9d7f11c
Clippy fixes
2023-02-13 21:33:42 -05:00
Joining7943
0ed6a9f882
tail: Fix parsing of sleep interval. Use duration parser from fundu crate.
...
Activate tests for parsing sleep interval
2023-02-12 20:23:55 +01:00
Daniel Hofstetter
a22749ec57
comm: enable "no_arguments" & "one_argument" tests
2023-02-09 10:51:32 +01:00
Daniel Hofstetter
ccf999473c
comm: use delimiter on "total" line
2023-02-07 09:22:55 +01:00
Sylvestre Ledru
efc70ade68
Merge pull request #4260 from sbentmar/expand-fix-perl-failures
...
expand: improve plus specifier handling
2023-01-28 18:15:08 +01:00
Sylvestre Ledru
d8c3205d4c
Merge pull request #4300 from cakebaker/comm_total
...
comm: implement --total
2023-01-28 18:14:17 +01:00
Joining7943
c809bb3888
tests/tail: Disable test_follow_with_pid on freebsd because of intermittent failures in the ci
2023-01-28 13:02:33 +01:00
Sebastian Bentmar Holgersson
1bf723fe40
expand: fix formatting issues and cleanup
2023-01-27 21:08:16 +01:00
Sebastian Bentmar Holgersson
69d8729598
expand: replace while loop with constant time algorithm
2023-01-27 21:08:16 +01:00
Sebastian Bentmar Holgersson
ddc6fabca0
expand: all perl tests passing
2023-01-27 21:08:16 +01:00
Sebastian Bentmar Holgersson
cbab8677e6
expand: improve handing of +
2023-01-27 21:08:16 +01:00
Daniel Hofstetter
f6b646e4e5
clippy: fix warnings introduced with Rust 1.67.0
2023-01-27 17:37:56 +01:00
Terts Diepraam
fc7e51a4f8
Merge pull request #4261 from Joining7943/tests-util-enhance-cmdresult
...
`tests/util`: Implement enhancements of `CmdResult` #4259
2023-01-25 10:06:32 +01:00
Daniel Hofstetter
b06485990d
comm: implement --total
2023-01-24 16:49:43 +01:00
Terts Diepraam
8c35465e03
Merge pull request #4265 from sylvestre/add_test_test
...
test: add a test matching what busybox is doing
2023-01-22 23:42:54 +01:00
Sylvestre Ledru
6f95f0953b
Merge pull request #4271 from eds-collabora/eds/nice
...
Support legacy argument syntax for nice
2023-01-22 20:57:08 +01:00
Joining7943
78a381032b
tests/util: Improve assertion messages of CmdResult::stderr_is_bytes
, stdout_is_bytes
2023-01-22 14:56:19 +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
Joining7943
7c0ed0340b
tests/util: Add stdout_check, stdout_str_check ... to CmdResult to run arbitrary assertions
2023-01-22 14:56:19 +01:00
Joining7943
c2ad54fe09
tests/util: Add methods in CmdResult to assert the received signal on unix systems
...
Add tests for these signal methods. Include `signals` feature in Cargo.toml uucore dev-dependencies.
2023-01-22 14:56:19 +01:00
Joining7943
19db042022
tests/util: Use ExitStatus instead of code, success in CmdResult. Rewrite tests for CmdResult
2023-01-22 14:48:23 +01:00
Joining7943
37e06edadc
tests/util: Introduce CmdResult::stdout_str_apply ... to preprocess stdout, stderr before asserting
2023-01-22 14:48:23 +01:00
Emil Suleymanov
50c1833c11
cp: require preserve only certain attributes ( #4099 )
...
* cp: require preserve only certain attributes
# Conflicts:
# src/uu/cp/src/copydir.rs
# src/uu/cp/src/cp.rs
* tests/cp: preserve all and preserve xattr tests with todos
* tests/cp: rename preserve tests
* tests/cp: add android fail test for preserve=xattr
On Android, this cp with explicit preserve of xattr must fail, because of the limitations of the filesystem setup used on Android.
* cp: verify some metadata in cp preserve tests
# Conflicts:
# tests/by-util/test_cp.rs
* cp: run test_cp_preserve_all in all OS's but only check metadata on linux
* test/cp: don't expect the mode to change in explicit cp preserve
* cp: attributes struct instead of enum for unified required tracking
* cp: refactor preserver and handle_preserve
# Conflicts:
# src/uu/cp/src/cp.rs
* cp: update preserve attr to max
* test/cp: fix the preserve xattr test
Access timestamps appear to be modified only in this test. Running the command directly does not alter the access timestamp.
* cp/test: preserve all and context case
* cp: fix preserve args value source
* test/cp: don't check mtime on freebsd
* test/cp: don't check mtime on macos
* test/cp: fix freebsd deps
* test/cp: support freebsd tests
* cp: simplify try_set_from_string
* cp: parse context attr in preserve in any case to show warning later
* cp: print warnings for attribute errors if not required
* cp: show SELinux warning only once
* cp: show SELinux warning without error
* Revert "cp: show SELinux warning without error"
This reverts commit d130cf0d8c8e28ac2c903413992613241decf879.
* cp: add documentation for preserve components
* cp: simplify try_set_from_string
* cp: EN_US "behavior" spelling for cspell
2023-01-19 13:02:06 +01:00
Ed Smith
8aa9f346ef
Support legacy argument syntax for nice
...
This introduces an argument preprocessing step for the nice tool in
order to support the legacy nice adjustment syntax (`nice -1 foo`,
`nice --1 foo`, `nice -+1 foo` and so forth).
This is a preprocessing step because the interaction between these
arguments and the existing `nice -n -1` syntax becomes context
dependent, in a way that is currently difficult to capture through
clap.
Signed-off-by: Ed Smith <ed.smith@collabora.com>
2023-01-18 11:44:41 +01:00
Sylvestre Ledru
8c137f5d7c
Merge pull request #4278 from cakebaker/sum
...
sum: fix output when using BSD sum algo (-r)
2023-01-18 11:33:41 +01:00
Sylvestre Ledru
afbe850115
Merge pull request #4279 from rivy/up.uname
...
change/uname ~ update and revise
2023-01-18 11:33:29 +01:00
Roy Ivy III
b4e3e66236
test/uname ~ test for invisible characters in output (ie, NULs)
2023-01-14 22:16:41 -06:00
Roy Ivy III
cfdbaca6c1
test/uname ~ update tests for expected platform-v1.0.2 outputs
2023-01-14 22:16:41 -06:00
Roy Ivy III
d78e1e7399
tests: revise/standardize usage error testing (for dd, install, mktemp, rm, seq, and touch)
2023-01-13 22:14:48 -06:00
Daniel Hofstetter
747bc2513e
sum: fix output when using BSD sum algo (-r)
2023-01-13 10:05:09 +01:00
Sylvestre Ledru
6a9660f9f6
Merge pull request #4268 from rivy/fix.sleep
...
Fix `sleep` argument parsing and errors
2023-01-12 18:41:04 +01:00
Roy Ivy III
f8b545d6f8
test/sleep: add and refine sleep
test cases
2023-01-08 12:10:32 -06:00
Sylvestre Ledru
b9e972094b
test: add a test matching what busybox is doing
2023-01-07 09:50:50 +01:00
Joining7943
463c58afd0
tests/tail: Remove redundant set_stdin(Stdio::null())
2023-01-03 16:30:12 +01:00
Joining7943
9b35c5d5c1
tests/util: Use Stdio::null as default in UCommand for Child stdin instead of Stdio::piped
2023-01-03 16:30:08 +01:00
Terts Diepraam
44ea43f058
tests: remove status_code, which is the same as code_is
2023-01-01 17:25:59 +01:00
Terts Diepraam
267a22e12c
add track_caller attribute to assertion functions
2023-01-01 15:25:37 +01:00
Terts Diepraam
36f3507bed
Merge pull request #4232 from TechHara/whitespace
...
cut: add whitespace option for separating fields
2023-01-01 12:58:28 +01:00
Sylvestre Ledru
a3c76678fe
Merge pull request #4247 from tertsdiepraam/rm/add-fifo-test
...
rm: add test for #4246
2022-12-30 12:09:53 +01:00
Roy Ivy III
737271de96
test/expr: add regex tests
2022-12-29 23:22:13 -06:00
Roy Ivy III
812d811ff6
test/expr: add simple value and EXIT_CODE tests
2022-12-29 22:49:02 -06:00
Roy Ivy III
be37e033be
test/expr: add more index testing of unicode strings
2022-12-29 22:49:02 -06:00
Roy Ivy III
8e7dbb0bf6
test/expr: add 'index' operator tests
2022-12-29 22:48:55 -06:00
Terts Diepraam
ea8085e2ca
rm: add test for #4246
2022-12-29 16:15:41 +01:00
jaggededgedjustice
b8a755a396
date: Catch panic from invalid format string ( #4240 )
...
* Catch panic from invalid date string
2022-12-25 21:11:34 +01:00
Terts Diepraam
bdd6f56ae4
Merge pull request #4231 from Joining7943/add-timeout-in-tests
...
`tests/common/util`: Add possibility to set timeout for UCommand and UChild. Add `rstest` with timeout macro to dev dependencies
2022-12-23 01:12:57 +01:00
TechHara
c29839f4f9
Merge branch 'main' into whitespace
2022-12-18 09:07:03 -05:00
Joining7943
09c04d9f3f
tests: Set timeout for tests which would fail with the default timeout in test_factor, test_sort
2022-12-17 21:55:01 +01:00
Joining7943
1d7447d42e
tests/util: Add setting timeout for UChild::kill and run and wait methods in UCommand and UChild.
...
Additional notes:
* Set default timeout to 30s
* Fix UChild::kill to always fail on timeout if zero
2022-12-17 21:53:39 +01:00
Sylvestre Ledru
8489e9b69c
Ignore some cp tests on android
...
Closes : #4233
2022-12-17 16:54:23 +01:00
TechHara
bae78e62e0
Merge branch 'main' into whitespace
2022-12-15 22:23:03 -05:00
Sylvestre Ledru
c5728a61b4
fix some clippy warnings ( #4229 )
...
* fix some clippy warnings
* Fix the last two
2022-12-14 15:42:07 +01:00
Terts Diepraam
e4bed1c087
Merge pull request #4135 from Joining7943/refactor-tail-check-warnings
...
`tail`: Refactor handling of warnings and early exits
2022-12-14 13:21:54 +01:00
TechHara
9798ae7987
fix clippy complaint
2022-12-13 20:34:01 -05:00
TechHara
11e64958d6
add test cases to cover cut -w failing options
2022-12-13 11:43:20 -05:00
Joining7943
b339f6d80c
tests/tail: Add all additional tests written during refactoring tail from tip of refactoring branch
...
Other changes summmary:
* Use module level imports instead of fully qualified imports where appropriate
* Fix intermittent failing test_positive_zero_bytes because of broken pipe
* Cleanup old disabled test for warning of following indefinitely
2022-12-13 16:16:14 +01:00
Joining7943
d57545d09c
tail: Refactor: Handle warnings and early exits in one place. Remove InputService ...
...
Other changes summary:
* Cleanup imports
* Remove stdin_is_pipe_of_fifo function
* Rename WatcherService to Observer
2022-12-13 16:16:08 +01:00
Terts Diepraam
7555527d07
Merge pull request #4225 from Joining7943/4223-fix-intermittent-test-failures
...
tests/util: Fix #4223 : intermittent failing uchild tests
2022-12-13 11:40:11 +01:00
TechHara
6516519af3
Merge branch 'main' into whitespace
2022-12-12 22:07:05 -05:00
Sylvestre Ledru
f9c0ca4383
Merge pull request #4184 from jfinkels/cp-verbose
...
cp: correct --verbose --parents output for both files and directories
2022-12-12 21:31:15 +01:00
TechHara
f6a0abaee3
add whitespace delimiter option
2022-12-12 12:00:57 -05:00
Joining7943
7ef9504952
tests/util: Fix intermittent failing uchild tests on macos. The ci can be slow, so increase delay.
...
Closes #4223
2022-12-12 12:52:10 +01:00
Kai M
42b9b7b62c
install: fix issue #3814 ( #3950 )
...
* install: fix installing one file when using -Dt options
* install: fix installing multiple files with -Dt
Code was missing the logic to create the target dir when multiple files
should be copied and target dir is given by -t option.
This simplifies the copy logic also when only one file should be copied
to the target dir.
* install: fix verbose output when using -D
Also adds a unit test to verify the same behaviour as the gnu tools.
* install: add more testcases for create leading dir
Tests various combinations of "-D" with and w/o "-t" when installing
either a single file or multiple files into a non existing directory.
install -D file1 file2 (-t) not_existing_dir
install -D file1 (-t) not_existing_dir/
Also fixes file formatting, spelling and adds some more test asserts.
* install: fix error for nonex. dir path ending on /
The install command failed with a different error message than the
original GNU install tool. Checking for a trailing slash fixes this.
Only works on unix though.
* install: add windows support when checking for '/'
* install.rs: fix spelling
* install.rs: add more tests regarding omitting dir
This increases the CI test coverage and also checks for more corner
cases to ensure uu_install is compliant with GNU's original.
export C=coreutils/target/debug/
rm -rf dir1 no-dir2 dir3 file
mkdir -p dir1 dir3
touch file
${C}install dir1/file1 dir1/.. no-dir2
${C}install dir1/file1 dir1/.. dir3
${C}install dir1/.. dir3
* install: improve test_install_missing_arguments
Also check that install returns the correct error messages, when only a
target directory is given via -t and that is is not created (-D option).
* install: rework the checks for missing file args
This ensures correct (GNU install like) behavior. Tests from the last
commit will pass now.
2022-12-06 09:11:23 +01:00
Jeffrey Finkelstein
1a839fb2c4
cp: correct --verbose --parents output for dirs
...
This commit corrects the behavior of `cp -r --parents --verbose` when
the source path is a directory, so that it prints the copied ancestor
directories. For example,
$ mkdir -p a/b/c d
$ cp -r --verbose --parents a/b/c d
a -> d/a
a/b -> d/a/b
'a/b/c' -> 'd/a/b/c'
2022-12-05 21:37:13 -05:00
Jeffrey Finkelstein
bd665ea44a
cp: correct --verbose --parents output for files
...
This commit corrects the behavior of `cp --parents --verbose` when the
source path is a file so that it prints the copied ancestor
directories. For example,
$ mkdir -p a/b d
$ touch a/b/c
$ cp --verbose --parents a/b/c d
a -> d/a
a/b -> d/a/b
'a/b/c' -> 'd/a/b/c'
Fixes #3332 .
2022-12-05 21:36:56 -05:00
Sylvestre Ledru
b7925465a8
factor: trim the input to fix some busybox results
2022-12-05 22:49:48 +01:00
Jeffrey Finkelstein
682667fd1d
cp: force link between two files that exist
...
Allow `cp` to link files that exist. For example,
$ touch src dest
$ cp -f --link src dest
Before this commit, an error was raised.
2022-12-04 19:36:05 -05:00
Jeffrey Finkelstein
bf54fce055
tests: skip inode check on BSD
2022-12-03 23:50:39 -05:00
Jeffrey Finkelstein
3a5b31a30f
dd: correct rendering of SI and IEC byte counts
...
Adjust the rendering of the concise byte counts in both SI and IEC
units to better match the behavior of GNU dd.
Before this commit,
$ head -c 1024 /dev/zero | dd > /dev/null
2+0 records in
2+0 records out
1024 bytes (1 KB, 1024 B) copied, 0.0 s, 1.0 MB/s
After this commit,
$ head -c 1024 /dev/zero | dd > /dev/null
2+0 records in
2+0 records out
1024 bytes (1.0 kB, 1.0 KiB) copied, 0.0 s, 1.0 MB/s
For comparison, GNU dd produces the following:
$ head -c 1024 /dev/zero | dd > /dev/null
2+0 records in
2+0 records out
1024 bytes (1.0 kB, 1.0 KiB) copied, 0.000332864 s, 3.1 MB/s
2022-12-03 10:14:00 -05:00
Sylvestre Ledru
75502aba93
Merge pull request #4136 from Joining7943/tail-test-runner
...
`tests/common/util`: Implement UChild, an abstraction for std::process::Child, to return UChild from run_no_wait instead
2022-12-03 10:18:25 +01:00
Sylvestre Ledru
818012e30b
Merge pull request #4193 from jfinkels/touch-relative-time
...
touch: add support for some relative times
2022-12-03 10:16:21 +01:00
Jeffrey Finkelstein
66ee373373
cp: preserve hard links when target already exists
...
Prevent a panic in `cp -a` when the target of a hard link already
exists in the target directory structure.
For example,
$ mkdir -p src dest/src
$ touch src/f dest/src/f
$ ln src/f src/link
$ cp -a src dest
The `cp` command now succeeds without error.
2022-12-02 23:50:18 -05:00
Joining7943
4a2ced5940
tests: Adjust some tests to use improved UChild. test_tac: Ignore pipe tests on windows.
...
Summary:
* Disable test_retry6 on android because of intermittent failures
* Use wait() instead of wait_with_output in test_cat, test_cp, test_sort
* tests/sort: Simplify usage of test_sigpipe_panic
* Fix tests in test_tee.
tests/tac:
There was a change in the `tests/common/util.rs` test api concerning piped input which may have
revealed a bug in the implementation of tac. Please see also
https://github.com/uutils/coreutils/pull/4136
2022-12-02 13:13:10 +01:00
Joining7943
4f54eedb74
tests/util: Improve UChild. Cleanup redundant functions in util.rs.
...
A short summary of changes:
* Add some basic tests for UChild and the run methods.
* Try more often in a fixed interval to create the tempfile for CapturedOutput.
* Fix drop order of struct fields for better cleanup of temporary files/dirs.
* Mark UChild::wait_with_output and UChild::pipe_in_and_wait_with_output deprecated
* Make CapturedOutput private
* Panic in stdout_all, stdout_all_bytes etc. if output is not captured.
* Rename some methods, refactor, clean up, fix documentation, add try_... methods
2022-12-02 08:06:48 +01:00
Joining7943
982fb682e9
tests: Use UChild in tests. Rename run_no_wait_child to run_no_wait and return UChild
...
tests/tail:
* test_stdin_redirect_file:. Test fails now when assert_alive()!
The follow test `tail -f < file` where file's content is `foo` fails with:
Assertion failed. Expected 'tail' to be running but exited with status=exit status: 0
I also tried on the command line and can confirm that tail isn't runnning when following by
descriptor. The test is deactivated until the implementation is fixed.
* test_follow_stdin_descriptor
* test_follow_stdin_explicit_indefinitely.
* test_follow_single
* test_follow_non_utf8_bytes
* test_follow_multiple
* test_follow_name_multiple
* test_follow_invalid_pid
* test_single_big_args
* test_retry3
* test_retry4
* test_retry5
* test_retry7
* test_retry8
* test_retry9
* test_follow_descriptor_vs_rename1
* test_follow_descriptor_vs_rename2
* test_follow_name_retry_headers
* test_follow_name_remove
* test_follow_name_truncate1
* test_follow_name_truncate2
* test_follow_name_truncate3
* test_follow_name_truncate4
* test_follow_truncate_fast
* test_follow_name_move_create1
* test_follow_name_move_create2
* test_follow_name_move1
* test_follow_name_move2
* test_follow_name_move_retry1
* test_follow_name_move_retry2
* test_follow_inotify_only_regular
* test_fifo
* test_illegal_seek
tests/cat:
* test_dev_full
* test_dev_full_show_all
* test_dev_random
* test_fifo_symlink
tests/dd:
* test_random_73k_test_lazy_fullblock
* test_sync_delayed_reader
tests/factor:
* test_parallel
tests/rm:
* test_rm_force_prompts_order
* test_rm_descend_directory
* test_rm_prompts
tests/seq:
* the helper run method
tests/sort:
* test_sigpipe_panic
tests/tee:
* the helper run_tee method
tests/tty:
* test_tty module
tests/yes:
* the helper run method
2022-12-02 08:06:45 +01:00
Joining7943
040a5e8301
tests/util: Implement UChild. UCommand: implement stderr_to_stdout, capture output as default
...
See pr #4136 (https://github.com/uutils/coreutils/pull/4136 )
2022-12-02 08:05:05 +01:00
Joining7943
9b446bf261
tests/tail: Fix clippy warning same-item-push. Do not push same flag twice.
2022-12-02 08:05:05 +01:00
Daniel Hofstetter
9a2174ba02
chore: standardize creation of empty strings
2022-12-01 13:49:23 +01:00
Jeffrey Finkelstein
9632db4f86
dd: correctly set file size when conv=sparse
...
Before this commit, if `sparsefile` were a regular file of non-zero
size whose contents are all null bytes, then
dd if=sparsefile of=outfile conv=notrunc
would have resulted in `outfile` having zero size as reported by
`stat`. After this commit, `outfile` will have the same size as
`sparsefile` (even if the contents are represented sparsely by the
filesystem).
2022-11-29 22:53:18 +01:00
Jeffrey Finkelstein
a396ebd883
touch: add support for some relative times
...
For example,
$ touch -d +1 days
Fixes #3964 .
2022-11-29 22:53:13 +01:00
Sylvestre Ledru
27958a27ef
Merge pull request #4159 from sylvestre/issue_3780
...
date: add a test for the issue 3780 to make sure we don't regress
2022-11-27 18:24:07 +01:00
Miles Liu
3896aa31be
cp: fix cp --force --backup f f
fails on macOS
2022-11-20 18:14:42 +08:00
Jeffrey Finkelstein
903ad1656d
dd: move tests of slow reader to test_dd.rs
...
Move some tests that simulate a slow reader from `dd.rs` to
`tests/by-util/test_dd.rs`, and employ a FIFO and `sleep()` to
simulate the slow reader instead of a custom struct that implements
`Read`. This change restricts the type of `Input`s the
`Output::dd_out()` function can accept, facilitating a future change
to make `Input` an enum.
2022-11-19 09:27:23 -05:00
Terts Diepraam
1b35e467ac
Merge pull request #4137 from jfinkels/dd-bytes-suffix
...
dd: allow B as a suffix for count, seek, and skip
2022-11-19 12:23:43 +01:00
Sylvestre Ledru
0e3d3f780b
Merge pull request #4155 from miles170/issue-3779-fix-ci-freebsd
...
CI: fix FreeBSD CI passed when tests failed
2022-11-19 10:06:59 +01:00
Sylvestre Ledru
6d7850549b
Merge pull request #4150 from tertsdiepraam/stat-refactor
...
`stat` refactor
2022-11-19 09:57:23 +01:00
Jeffrey Finkelstein
701550d76b
dd: allow B as a suffix for count, seek, and skip
...
Allow uppercase "B" on its own as a unit specifier for the `count`,
`seek`, and `skip` arguments to `dd`.
For example,
$ printf "abcdef" | dd count=3B status=none
abc
2022-11-18 20:27:42 -05:00
Sylvestre Ledru
4d16132948
date: add a test for the issue 3780 to make sure we don't regress
2022-11-18 21:32:59 +01:00
Miles Liu
d748e3900b
test_cp: ignore failing tests for FreeBSD
2022-11-19 00:05:37 +08:00
Sylvestre Ledru
435ef5da8b
Merge pull request #4132 from tertsdiepraam/sort-accept-sort-mode-multiple-times
...
`sort`: allow a sort mode to appear multiple times
2022-11-17 21:43:28 +01:00
Terts Diepraam
33cbc94f25
rm: use uucore::prompt_yes over custom prompt function
2022-11-17 15:12:18 +01:00
Terts Diepraam
91df2b1709
mv: use uucore::prompt_yes over custom function
2022-11-17 15:11:19 +01:00
Terts Diepraam
7bb0e8f849
ln: use uucore::prompt_yes over custom function
2022-11-17 15:10:26 +01:00
Terts Diepraam
ed34264b95
cp: use uucore prompt_yes instead of custom
2022-11-17 15:09:34 +01:00
Sylvestre Ledru
c00fc0a8c4
Merge pull request #4146 from niyaznigmatullin/clippy_fix
...
Run `cargo +nightly clippy --fix`
2022-11-17 10:33:40 +01:00
Terts Diepraam
b0224e8145
stat: move unit tests to stat.rs instead of test_stat.rs
2022-11-16 21:17:39 +01:00
Terts Diepraam
7e5b6400e3
stat: use Flags struct instead of u8 bit manipulation
2022-11-16 21:12:40 +01:00
Niyaz Nigmatullin
fdd6a05259
chore: run cargo +nightly clippy --fix
2022-11-16 11:09:44 +02:00
Emil Suleymanov
a6c48b084c
test_cp: verify metadata for preserve no args case
2022-11-16 01:39:25 +01:00
Terts Diepraam
03c40b2db2
sort: allow a sort mode to appear multiple times
...
A test case for this is `sort -k 2n,2n` which should be accepted, because `n` is
compatible with itself.
Resolves issue #4129 .
2022-11-15 14:22:01 +01:00
Niyaz Nigmatullin
f73f686ca3
test_cp: temporarily disable non-working test on Android
2022-11-15 10:00:59 +02:00
Jeffrey Finkelstein
416a742e31
cp: use sparse copy on --sparse=always
...
Correct the behavior of `cp --reflink=never --sparse=always` so that
it performs a sparse copy. Before this commit, it was incorrectly
performing a dense copy.
2022-11-10 21:43:19 -05:00
Emil Suleymanov
1172a7e781
cp: remove interactive mode message on 'no' ( #4069 )
2022-11-10 12:45:18 +01:00
Sylvestre Ledru
9a5d18b8f6
Weird env variable names should trigger an error.
...
For example `env a=b=c printenv a=b` should fail
Tested by tests/misc/printenv.sh
2022-11-06 17:35:00 +01:00
Sylvestre Ledru
8e5c259e4b
Merge pull request #3966 from jfinkels/cp-backup-force
...
cp: force copying file to itself with --backup
2022-11-06 08:43:52 +01:00
Sylvestre Ledru
3ea7a061d7
Merge pull request #4097 from devnexen/fbsd_test_fix
...
fix cp tests build since they re supposed to be ignored on freebsd an…
2022-11-06 07:41:16 +01:00
Sylvestre Ledru
446df9da5a
Merge branch 'main' into cp-backup-force
2022-11-06 07:24:48 +01:00
Sylvestre Ledru
47e3149e85
Merge pull request #3978 from jfinkels/cp-copy-contents-fifo
...
cp: implement --copy-contents option for fifos
2022-11-06 07:23:25 +01:00
Jeffrey Finkelstein
5b100fef62
cp: implement --copy-contents option for fifos
...
Implement the `--copy-contents` option when the source is a FIFO, so
that the contents of the FIFO are copied (when the bytes become
available for reading) instead of the FIFO object itself. For example,
$ mkfifo fifo
$ cp --copy-contents fifo outfile &
[1] 1614080
$ echo foo > fifo
$ cat outfile
foo
[1]+ Done cp --copy-contents fifo outfile
2022-11-05 19:25:37 -04:00
Jeffrey Finkelstein
fbed01dd54
cp: force copying file to itself with --backup
...
Fix the behavior of `cp` when both `--backup` and `--force` are
specified and the source and destination are the same file. Before
this commit, `cp` terminated without copying and without making a
backup. After this commit, the copy is made and the backup file is
made. For example,
$ touch f
$ cp --force --backup f f
results in a backup file `f~` being created.
2022-11-05 19:23:50 -04:00
Sylvestre Ledru
6bc68cdcdf
Merge branch 'main' into refactor/add_nix_error_auto_conversion
2022-11-04 12:54:35 +01:00
Orhun Parmaksız
be49eb68f3
fix: address test failures
2022-11-04 13:35:54 +03:00
Daniel Hofstetter
8114abc956
Fix "needless borrow" clippy warning in env test
2022-11-04 11:10:35 +01:00
Sylvestre Ledru
2d79c4f693
Merge pull request #4091 from dmatos2012/allow-default-value-mktemp
...
mktemp: allow default missing value
2022-11-03 20:46:11 +01:00