Commit graph

2819 commits

Author SHA1 Message Date
Sylvestre Ledru
a596cda516
Merge pull request #5355 from boxdot/main
relpath: remove
2023-10-06 20:39:25 +02:00
Luv_Ray
7bf4b7f674
tests/expr: add tests in test_expr.rs 2023-10-07 00:42:04 +08:00
Zhuoxun Yang
5a732dd21a tests/expr: add test expr 1 \| a / 5 2023-10-06 23:50:44 +08:00
Daniel Hofstetter
6dd53c7a71 clippy: fix warnings in tests 2023-10-06 10:11:26 +02:00
boxdot
e88183174b
relpath: remove
Closes #5236
2023-10-04 16:13:06 +02:00
tommady
5ce3720820
fix freebds mode_t is u16 but other unix platforms are u32 2023-10-04 09:12:26 +00:00
tommady
879b4f363d
Merge branch 'main' into fix-5327 2023-10-04 16:06:48 +08:00
tommady
88f88e51cc
fix expected , found and spelling errors 2023-10-04 07:12:25 +00:00
Terts Diepraam
9e9701974e
Merge pull request #5350 from cakebaker/echo_no_new_line
echo: don't output "\n" if "\c" is encountered
2023-10-03 17:35:58 +02:00
Daniel Hofstetter
54ba81ecbb mv: fix typo in test function name
test_mv_info_self -> test_mv_into_self
2023-10-03 15:09:20 +02:00
Daniel Hofstetter
c29bcb219f echo: don't output "\n" if "\c" is encountered 2023-10-03 14:37:15 +02:00
Daniel Hofstetter
139f205783
Merge pull request #5218 from tertsdiepraam/echo-fix-octal-wrapping
`echo`: fix wrapping behavior of octal sequences
2023-10-03 13:52:56 +02:00
Terts Diepraam
689b21d0b8
Merge pull request #5348 from cakebaker/cp_show_no_skipped_message
cp: show no "skipped" msg with -vi/-vin
2023-10-03 11:58:47 +02:00
Terts Diepraam
0f248d7525
Merge pull request #5347 from cakebaker/mv_show_no_skipped_message
mv: show no "skipped" msg with -vi/-vin
2023-10-03 11:58:31 +02:00
PGIII
252d01ac33
cp: fail when trying to copy to read only file on mac (#5261)
* cp: fail when trying to copy to read only file

* fix spelling error in macos.rs

* simplify permissions check

* add comment

* fix typo
2023-10-03 00:48:22 +02:00
Yury Zhytkou
c5a0aa92f8
split: implementing separator option (#5331)
* split: implementing separator option

* split: separator option - handle multiple update

* split: style

* split: separator tests

* split: separator tests - stdin in ci/cd

* split: tests - ci/cd stdin errors

* split: refactor based on feedback

* split: improve test coverage

* split: fix broken pipe error in tests with stdin

* split: fix for handle_multiple_separator_options

* split: comments

* split: refactor separator code

* split: changes based on feedback

* split: changes based on feedback
2023-10-03 00:42:46 +02:00
Daniel Hofstetter
8ee69d2b92 cp: show no "skipped" msg with -vi/-vin 2023-10-02 15:38:34 +02:00
Daniel Hofstetter
fda762b91c mv: show no "skipped" msg with -vi/-vin 2023-10-02 14:50:29 +02:00
Daniel Clarke
c27fcc4084
Update parse_datetime to 0.5.0 (#5313) 2023-10-01 18:01:46 +02:00
Sylvestre Ledru
7337cd5169 ls -R1: add a test to replicate GNU's recursive.sh 2023-10-01 17:03:57 +02:00
Daniel Hofstetter
95ccc54d05 nl: defer showing "line number overflow" error 2023-09-30 15:35:05 +02:00
tommady
718a527e9b
add testcase for no preserve mode 2023-09-30 07:09:57 +00:00
Daniel Hofstetter
bc7877b58c
Merge pull request #5124 from shinhs0506/seq-parse
seq: parse "infinity" and "-infinity"
2023-09-30 06:59:32 +02:00
Daniel Hofstetter
035032cd83
Merge pull request #5158 from cakebaker/nl_section_delimiter
nl: implement -d/--section-delimiter
2023-09-29 10:42:04 +02:00
Daniel Hofstetter
51eb20a15d fmt: use clap's value parser for goal & width 2023-09-28 10:50:56 +02:00
tommady
2789885648
cp: fix cp -dR --no-preserve=links d c should have different inodes (#5320)
* fix issue 5308
2023-09-27 13:16:10 +02:00
Daniel Hofstetter
ff500d7d6f expr: interpret numbers != 0 as true for | and & 2023-09-26 16:24:00 +02:00
Sylvestre Ledru
99120d32c1 cut: fail when the input == usize::MAX 2023-09-26 09:40:21 +02:00
Terts Diepraam
45487d47b8 extract Base enum 2023-09-25 12:02:45 +02:00
Leviticoh
b90b59c003
uniq: added support for deprecated -N option (#4228) 2023-09-24 14:44:44 +02:00
Sylvestre Ledru
e8b27d1714
Merge pull request #4527 from bbara/dd-skip-seek
dd: fix GNU test 'dd/skip-seek-past-dev'
2023-09-24 14:43:15 +02:00
Terts Diepraam
4ca792d2ff
Merge pull request #5306 from cakebaker/nl_fix_output_order_if_stdin_and_files_are_mixed
nl: fix output order if stdin and files are mixed
2023-09-24 12:12:54 +02:00
tommady
bd0fb817a7
cp: fix the result of inodes are not the same when preserve links is flagged (#5064)
Should fix:
```
rm -rf a b c
touch a
ln -s a b
mkdir c
./target/debug/coreutils cp --preserve=links -R -H a b c
a_inode=$(ls -i c/a|sed 's,c/.*,,')
b_inode=$(ls -i c/b|sed 's,c/.*,,')
echo "$a_inode" = "$b_inode"
```
2023-09-24 10:53:27 +02:00
Benjamin Bara
17f4d17021 tests: dd: add skip-seek-past-dev tests
These tests try to read or write past a block device, where the block device is either given as
stdin or stdout. It requires access to the block device, and therefore is executed as root. For now,
it is assumed that a block device "/dev/sda1" with a size smaller than 10000000000000000 exists.
2023-09-24 10:00:10 +02:00
Benjamin Bara
616c3f4a7f util: extend run_ucmd_as_root for stdin/stdout
This enables to give path to files (as str) which are then used as either stdin or stdout.
2023-09-24 10:00:10 +02:00
Daniel Hofstetter
06219350fa nl: fix output order if stdin and files are mixed 2023-09-23 14:44:30 +02:00
Sylvestre Ledru
ba3f266b2c
Merge pull request #5285 from cakebaker/nl_multiple_files
nl: make line number and --join-blank-lines work over multiple files
2023-09-23 09:34:04 +02:00
Sylvestre Ledru
d6da6fb546
Merge pull request #5302 from cakebaker/relpath_fix_5300
relpath: show error if no argument provided
2023-09-22 23:30:52 +02:00
Daniel Hofstetter
38831c46d1 relpath: show error if no argument provided
Fixes #5300
2023-09-22 10:58:12 +02:00
Daniel Hofstetter
0794d1338d ls: fix test which fails if /tmp uses tmpfs 2023-09-22 10:43:23 +02:00
Sylvestre Ledru
9b4d2c6bc4
ls: implement --dired
* Support ls --dired

* stat-failed.sh: update of the test - we have a small difference

* ls --dired: address some of the comments

* fix warnings

* use unwrap()

* Improve test

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

* Simplify test

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

* Remove a word from the spell ignore

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

* remove duplication of the spell ignore

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

* rustfmt

---------

Co-authored-by: Daniel Hofstetter <daniel.hofstetter@42dh.com>
2023-09-20 08:17:46 +02:00
Daniel Hofstetter
1a30a1b8b6 nl: support --join-blank-lines over multiple files 2023-09-19 10:47:20 +02:00
Daniel Hofstetter
1107fadca9 nl: increase line number over multiple files 2023-09-19 10:47:00 +02:00
Sylvestre Ledru
37ee889003 ls -l: show an error when symlink not readable
switching to match and handle the error

Will help with tests/ls/stat-failed.sh
2023-09-15 22:34:17 +02:00
Daniel Hofstetter
39a0e92a91
Merge pull request #5255 from granquet/split_filter_broken_pipe
split: catch broken pipe error for round robin strategy
2023-09-13 14:08:45 +02:00
Daniel Hofstetter
aa7b39ae49 split: fix formatting 2023-09-13 10:45:38 +02:00
Guillaume Ranquet
d4217c5a12 split: catch broken pipe error for round robin strategy
The broken pipe error is not handled in the case of the round robin
strategy (typically used with --filter).

Align to the other strategies to silence that error in that use case
too.

fixes #5191

Signed-off-by: Guillaume Ranquet <granquet@baylibre.com>
2023-09-12 17:43:31 +02:00
Daniel Hofstetter
6ce80758d5 touch: fix deprecation warnings from chrono
datetime_from_str() has been deprecated
2023-09-12 15:08:21 +02:00
Sylvestre Ledru
80f8eb6724
Merge pull request #5252 from zhitkoff/split-gnu-test-fail.sh
split: implement remaining -n variants and pass GNU tests/split/fail.sh
2023-09-07 17:15:09 +02:00
zhitkoff
3f065eed8a split: fixing test for 32bit 2023-09-06 21:04:01 -04:00
zhitkoff
8883f016d4 split: fix windows tests 2023-09-06 20:09:26 -04:00
zhitkoff
3be284e0d9 split: more test coverage 2023-09-06 19:49:26 -04:00
zhitkoff
fbf5ac4329 split: tests 32bit 2023-09-06 14:16:21 -04:00
zhitkoff
1669a92694 split: tests overflow 2023-09-06 14:02:08 -04:00
zhitkoff
4fd598e4d5 split: tests 2023-09-06 13:20:58 -04:00
zhitkoff
e378454a26 split: formatting 2023-09-06 13:15:35 -04:00
zhitkoff
d8a16a2351 split: tests 2023-09-06 12:42:49 -04:00
zhitkoff
a0a9ee6491 split: fixing tests for parse_size_max() 2023-09-05 18:42:16 -04:00
David Matos
8be6338da9 cp: Error out if cp only contains source 2023-09-05 23:35:14 +02:00
Yury Zhytkou
e0b000a3bc
Merge branch 'main' into split-gnu-test-fail.sh 2023-09-05 17:22:31 -04:00
Daniel Hofstetter
4992cb9b86 Use std::io::IsTerminal instead of is-terminal 2023-09-04 10:35:17 +02:00
Daniel Hofstetter
8920ac0123 split: fix clippy warning in test 2023-09-04 07:26:23 +02:00
zhitkoff
420965a3ab prereq for fixing tests/split/fail.sh 2023-09-03 20:39:50 -04:00
Sylvestre Ledru
633ae06524
Merge pull request #5225 from tertsdiepraam/factor-short-circuit-write-error
`factor`: short circuit on write error, but not on parse error
2023-09-01 21:09:25 +02:00
zhitkoff
e597189be7 split: fixed windows test for invalid unicode args 2023-08-31 20:48:44 -04:00
zhitkoff
d2812cbbc3 split: disable windows test for invalid UTF8 2023-08-31 16:04:44 -04:00
zhitkoff
5bfe9b19ef split: avoid using collect_lossy + test for invalid UTF8 arguments 2023-08-31 14:46:56 -04:00
zhitkoff
6f37b4b4cf split: hyphenated values + tests 2023-08-30 19:29:57 -04:00
Terts Diepraam
9a67393c44 factor: short circuit on write error, but not on parse error 2023-08-30 18:51:29 +02:00
zhitkoff
7f905a3b8d split: edge case for obs lines within combined shorts + test 2023-08-29 16:35:00 -04:00
Terts Diepraam
1ad10dd371 echo: add support for \NNN octal escape sequence 2023-08-29 21:54:19 +02:00
zhitkoff
15c7170d20 split: fix for GNU Tests regression + tests 2023-08-29 15:49:47 -04:00
Terts Diepraam
93a54f36f3 hashsum: change debug to display format with --tag 2023-08-29 10:15:38 +02:00
zhitkoff
fa8d18b826 split: refactor obsolete lines 2023-08-28 18:24:21 -04:00
Terts Diepraam
4623575a66 echo: fix wrapping behavior of octal sequences 2023-08-28 23:21:39 +02:00
Yury Zhytkou
1eae064e5c
split: better handle numeric and hex suffixes, short and long, with and without values (#5198)
* split: better handle numeric and hex suffixes, short and long, with and without values
Fixes #5171

* refactoring with overrides_with_all() in args definitions

* fixed comments

* updated help on suffixes to match GNU

* comments

* refactor to remove value_parser()

* split: refactor suffix processing + updated tests

* split: minor formatting
2023-08-28 10:09:52 +02:00
zhitkoff
84d96f9d02 split: refactor for more common use case 2023-08-26 11:11:46 -04:00
Daniel Hofstetter
db342556c2 nl: implement -d/--section-delimiter 2023-08-26 16:15:26 +02:00
Daniel Hofstetter
01b2834f2e Fix clippy warnings with Rust 1.72.0 2023-08-25 13:22:02 +02:00
Terts Diepraam
c3f9e19a3b all: normalize license notice in all *.rs files 2023-08-24 12:21:09 +02:00
Daniel Hofstetter
1b705ae07c factor: simplify loop in test 2023-08-22 09:45:17 +02:00
Sylvestre Ledru
0b9c829bce
Merge pull request #5182 from sylvestre/clippy_
Fix some of the recent clippy warnings
2023-08-21 16:21:02 -04:00
Sylvestre Ledru
bf5b765cba
Remove the author copyright notices (#5184)
* Remove the author copyright notices

Rational:
* not maintained
* does not reflect reality
* don't provide any value (the info can be found in the git log)
* we don't have rules to update them
  (ex: should you update it after one line, two lines, etc)

Co-authored-by: Daniel Hofstetter <daniel.hofstetter@42dh.com>
2023-08-21 12:23:18 +02:00
Sylvestre Ledru
d8f28364f0
Merge pull request #5168 from cakebaker/chown_remove_duplication_in_tests
chown: remove some duplication in tests
2023-08-21 12:22:32 +02:00
Sylvestre Ledru
bfca6bf70f Add license headers on all files 2023-08-21 10:49:27 +02:00
Sylvestre Ledru
7c9f4ba92a Fix some clippy warnings 2023-08-21 08:41:40 +02:00
tommady
b5746f794c
date: fix panic when input will cause overflow (#5160)
* fix issue 5149

* fix clippy style issue

* fix spell issue

* address comment

* address comments

* fix cspell
2023-08-20 16:55:38 +02:00
Daniel Hofstetter
d604f709ce nl: handle line number overflow 2023-08-19 07:16:06 +02:00
Terts Diepraam
f1978955ba
Merge pull request #5156 from cakebaker/nl_implement_try_from_for_numbering_style
nl: implement TryFrom<&str> for NumberingStyle
2023-08-18 23:10:32 +02:00
Daniel Hofstetter
8b9509a55b chown: remove some duplication in tests 2023-08-18 16:11:11 +02:00
Bluelief
a7ab660a38
fmt: change test to ignore and fix test output
- fix test to get same result as GNU fmt
2023-08-15 00:43:32 +09:00
Bluelief
946e1bb2d1
fmt: fix panic on width argument 2023-08-14 22:47:21 +09:00
Daniel Hofstetter
d5ab7bbacd nl: implement TryFrom<&str> for NumberingStyle 2023-08-13 14:09:15 +02:00
Daniel Hofstetter
08e21e183b nl: re-add handling for -p/--no-renumber 2023-08-12 14:36:22 +02:00
John Shin
631b9892f6 split: loop over chars and remove char_from_digit function 2023-08-11 18:36:08 -07:00
Terts Diepraam
31eebea804
Merge pull request #5131 from cakebaker/nl_refactoring
nl: fix output of numbering styles
2023-08-10 23:52:30 +02:00
Rayhan Faizel
4143859266 tests/stat: Test case for using - and -f together 2023-08-10 08:41:19 +05:30
Daniel Hofstetter
cef9ab10c3 sleep: adapt two tests to fundu 2.0.0 2023-08-08 09:10:33 +02:00
John Shin
2bb56d44a4 seq: add tests for infinity and -infinity args 2023-08-05 19:40:45 -07:00
Daniel Hofstetter
271606ddfa nl: fix output of numbering styles 2023-08-03 16:53:56 +02:00