Commit graph

2540 commits

Author SHA1 Message Date
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
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