Commit graph

2336 commits

Author SHA1 Message Date
Zhuoxun Yang
44702940d2 tests/expr: check prefix operation 2023-11-21 22:06:20 +08:00
clara swanson
58087df02a
stdbuf: remove crash macro (#5549)
* stdbuf: remove crash! macro

* stdbuf: change target_vendor back to apple

* tests/stdbuf: change stderr_only to usage_error in test_stdbuf_invalid_mode_fails

* stdbuf: add exit code to check_option

* stdbuf: remove set_exit_code line from error
2023-11-20 10:16:18 +01:00
Yury Zhytkou
eb00c195c6
split: pass GNU tests/b-chunk.sh (#5475)
---------

Co-authored-by: Terts Diepraam <terts.diepraam@gmail.com>
Co-authored-by: Daniel Hofstetter <daniel.hofstetter@42dh.com>
Co-authored-by: Brandon Elam Barker <brandon.barker@gmail.com>
Co-authored-by: Kostiantyn Hryshchuk <statheres@gmail.com>
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2023-11-17 17:19:10 +01:00
Daniel Hofstetter
2f9fcf73fa clippy: fix warnings introduced by Rust 1.74 2023-11-16 16:21:28 +01:00
ALXD
3cdb0966ae printf: add a test for %x with invalid value 2023-11-15 17:51:43 +01:00
Daniel Hofstetter
12e61d451c du: make -l/--count-links work 2023-11-09 16:07:02 +01:00
Terts Diepraam
1cae4981e6
Merge pull request #5508 from cakebaker/cp_fix_test_closes_file_descriptors
cp: make test_closes_file_descriptors Linux-only
2023-11-09 09:45:16 +01:00
Zhuoxun Yang
fb414ed917 tests/printf: support %q 2023-11-09 10:18:27 +08:00
Daniel Hofstetter
761213f1d2 cp: make test_closes_file_descriptors Linux-only 2023-11-08 09:33:49 +01:00
Daniel Hofstetter
7afb8461cb du: add -H (alias for --dereference-args) 2023-11-07 10:30:54 +01:00
Sylvestre Ledru
1818632d7c
Merge pull request #5496 from cakebaker/cp_tail_fix_warnings_in_tests
cp,tail: fix warnings in tests on Android
2023-11-06 07:51:32 +01:00
Daniel Hofstetter
bbdde2890a du: ignore test under Android & FreeBSD 2023-11-05 14:27:20 +01:00
Daniel Hofstetter
91b19b7c56 cp,tail: fix warnings in tests on Android 2023-11-05 13:56:39 +01:00
Daniel Hofstetter
29f6631554 du: add -P/--no-dereference 2023-11-03 17:17:44 +01:00
zhitkoff
62887c7a58 split: directory separator in additional suffix 2023-11-02 17:17:38 +01:00
zhitkoff
f05474a33a split: slash separator 2023-11-02 17:17:38 +01:00
zhitkoff
fbb454a080 split: suffix auto-widening and auto-width tests 2023-11-02 17:17:38 +01:00
Terts Diepraam
98ad01b1cc
Merge pull request #5471 from cakebaker/cp_fix_unused_variable_warnings
cp: restrict two test functions to linux/mac/win
2023-11-01 09:11:38 +01:00
tommady
a4775d288b
cp: fix cp -rT dir dir2 leads to different result than with GNU cp (#5467)
* add a test case test_cp_treat_dest_as_a_normal_file

* fix 5457

* cp: fix comment

---------

Co-authored-by: Daniel Hofstetter <daniel.hofstetter@42dh.com>
2023-10-30 17:55:03 +01:00
Daniel Hofstetter
a7cc3b6dca cp: restrict two test functions to linux/mac/win 2023-10-29 14:37:47 +01:00
Sylvestre Ledru
c24a51403a
cat: return the same error message as GNU with loop symlink (#5466)
* cat: return the same error message as GNU with loop symlink

Should fix tests/du/long-sloop.sh because it is using cat as a ref
for error messages

Co-authored-by: Daniel Hofstetter <daniel.hofstetter@42dh.com>
2023-10-28 22:29:24 +02:00
Mick van Gelderen
5c100dd088
mv: Fix stderr output mv file into dir and dir into file where both are files (#5464)
* Add tests mv file into dir and dir into file where both are files

* Fix test_mv_dir_into_file_where_both_are_files

* Fix test_mv_file_into_dir_where_both_are_files

* Store String in error instead of PathBuf

* Implement path_ends_with_terminator for windows

* Fix compilation on windows
2023-10-28 15:04:51 +02:00
Daniel Hofstetter
9f5db29145 cp: add test for --attributes-only 2023-10-27 09:34:31 +02:00
Daniel Hofstetter
6085cf12e3
Merge pull request #5353 from tommady/fix-5327
cp: fix cp -a --no-preserve=mode doesn't keep fully the mode
2023-10-25 13:34:45 +02:00
Terts Diepraam
96d0830952
Merge pull request #5446 from cakebaker/ls_try_get_matches_from
ls: use try_get_matches_from instead of get_matches_from
2023-10-25 11:25:40 +02:00
Daniel Hofstetter
9df50096c8
cp: remove "all" from cfg; rename test fn 2023-10-25 10:15:46 +02:00
Nathan Houghton
db26dabd6e tests/dd: Do not use the OS provided dd utility on FIFOs
On *BSD and macOS, the system provided dd utility opens up the output
file for both reading and writing. This means that the open/write to the
FIFO does not block, and almost instantly completes. The system dd then
exits, leaving nothing left to be read by the time the coreutils-rs dd
tries to open/read the FIFO.

Avoid this problem by just writing to the FIFO from the test case
itself, rather than relying on the system provide dd.
2023-10-25 00:05:56 -07:00
Daniel Hofstetter
6f84e56e28 ls: return exit code 2 for invalid time-style 2023-10-24 16:33:04 +02:00
Daniel Hofstetter
fd18d2686f ls: return exit code 2 for -l --dired --zero 2023-10-24 14:48:24 +02:00
David Matos
769eb29cd3
mv: moving directory itself should fail (#5429)
* mv: moving directory itself should fail

* mv: Check trailing slash also fails on target containing itself

* mv: add "spell-checker:ignore mydir" to test

---------

Co-authored-by: Daniel Hofstetter <daniel.hofstetter@42dh.com>
2023-10-24 10:54:23 +02:00
Nathan Houghton
dbfd700502 test: use mtime for -ot and fix direction of comparison
- Use the file modification time instead of the creation time (matches
  GNU coreutils documentation)

- Fix direction of comparison (a < b instead of a > b)

- Extend test case to cover both the 0 and 1 exit code cases
2023-10-22 17:44:40 -07:00
Sylvestre Ledru
03d598d08b
Merge pull request #5430 from cakebaker/cp_remove_destination_shouldnt_fail
cp --remove-destination: don't fail if destination is symlink to source
2023-10-22 22:17:32 +02:00
Daniel Hofstetter
772892e2e4 cp: --rem don't fail if dest is symlink to source 2023-10-20 09:41:30 +02:00
Yury Zhytkou
eede467e21
split : --filter and stdin updates (#5418) 2023-10-20 08:47:32 +02:00
Sylvestre Ledru
f971a69d69
ls --dired -R: fix the positions (#5341)
* move get_offset_from_previous_line into a specific function

* dired: improve the -R support

* dired: fix the display with subdir

* ls --dired -R: fix the positions

* ls --dired -R: verify also the SUBDIRED coordinate

* ls --dired -R: add a long file name and fix a windows test

* dired: always put dired first in the args + minor fixes

Co-authored-by: Daniel Hofstetter <daniel.hofstetter@42dh.com>

* ls: add cognitive_complexity to silent a warning

---------

Co-authored-by: Daniel Hofstetter <daniel.hofstetter@42dh.com>
2023-10-19 14:17:34 +02:00
Daniel Hofstetter
a3c6d6d91e
Merge pull request #5423 from Luv-Ray/fix-pathchk-issue5314
`pathchk`: check empty path by default
2023-10-19 09:33:42 +02:00
Zhuoxun Yang
4424091592 tests/pathchk: check error message 2023-10-19 01:29:53 +08:00
Sylvestre Ledru
4573eb693f
Merge pull request #5357 from zhitkoff/issue5334-uucore-parse-r-q
Implement SI prefixes R and Q
2023-10-18 18:55:17 +02:00
Zhuoxun Yang
f63f9a06f6 tests/pathchk: test empty path 2023-10-18 22:50:54 +08:00
zhitkoff
7038657a44 implement R and Q prefixes 2023-10-17 10:50:50 -04:00
zhitkoff
cb7479e823 uucore: implement SI suffixes R and Q 2023-10-17 10:50:50 -04:00
Zhuoxun Yang
04ab5b0108 tests/expr: add tests for "" 2023-10-17 22:26:19 +08:00
Zhuoxun Yang
7421c81a22 tests/expr: sort test cases 2023-10-17 22:21:44 +08:00
Daniel Hofstetter
541ac6a813
Merge pull request #5403 from sylvestre/rm
rm: In some cases, remove_dir is doing a better job than remove_dir_all
2023-10-16 09:35:44 +02:00
Luv_Ray
46b8b41e3f
Merge branch 'main' into fix-expr-syntex-error 2023-10-14 23:50:21 +08:00
Zhuoxun Yang
5b1755387f tests/expr: test escape 2023-10-14 23:18:15 +08:00
Daniel Hofstetter
f6880bff8f expr: test some invalid syntaxes 2023-10-14 14:58:41 +02:00
Sylvestre Ledru
505ef714b9 rm: In some cases, remove_dir is doing a better job than remove_dir_all
use it when remove_dir_all failed

GNU compatibility (rm/empty-inacc.sh)
2023-10-14 12:09:27 +02:00
Zhuoxun Yang
40f05a331e tests/expr: add tests for test_and 2023-10-14 01:58:53 +08:00
Sylvestre Ledru
41188a915e
rename the test
Co-authored-by: Daniel Hofstetter <daniel.hofstetter@42dh.com>
2023-10-13 11:35:45 +02:00