Jeffrey Finkelstein
d74fb62df7
tac: support null separator
2021-08-01 19:47:21 -04:00
Sylvestre Ledru
24b1822cba
Merge pull request #2468 from thomasqueirozb/tail_stdin
...
tail: handle `-` as an alias for stdin
2021-08-02 00:24:28 +02:00
Thomas Queiroz
6127ea9642
tests/tail: add test for as an alias for stdin
2021-08-01 17:20:30 -04:00
Michael Debertol
450a487d76
sort: ignore broken pipes in a test
...
Since sort exits early due to the nonexistent file, it might no longer
be around when we try to send it the input.
This is "by design" and can be ignored.
2021-08-01 18:02:52 +02:00
Michael Debertol
af47c66a00
sort: improve tests
2021-08-01 17:12:35 +02:00
Sylvestre Ledru
2d84c68f20
Merge branch 'master' into sort/input-is-output
2021-08-01 13:51:19 +02:00
Michael Debertol
663c9751a1
sort: do not exit with failure for "--version" or "--help"
2021-08-01 00:05:08 +02:00
Michael Debertol
418f5b7692
sort: handle empty merge inputs
2021-07-31 21:02:20 +02:00
Michael Debertol
5bf4536bdd
sort: ignore failure to truncate the output file
2021-07-31 21:02:20 +02:00
Michael Debertol
849086e9c5
sort: handle cases where the output file is also an input file
...
In such cases we have to create a temporary copy of the input file to prevent
overwriting the input with the output. This only affects merge sort, because it
is the only mode where we start writing to the output before having read all inputs.
2021-07-31 21:02:18 +02:00
Sylvestre Ledru
103a9d52ff
Merge pull request #2521 from miDeb/sort/rand
...
sort: improve compatibility of --random-sort
2021-07-31 21:00:18 +02:00
Michael Debertol
3564dc5792
sort: compare strings before comparing hashes
...
Since lines that compare equal should be sorted together, we need to first
compare the lines (taking settings into account). Only if they do not compare
equal we should compare the hashes.
2021-07-31 20:07:05 +02:00
Michael Debertol
f851fb6454
sort: initialize the salt when the random setting is on a key as well
...
Additionall, change the type of `salt` from `String` to `Option<[u8; 16]>`.
2021-07-31 20:07:05 +02:00
Michael Debertol
095e53aed2
sort: disallow equal lines for --check with --unique
2021-07-31 19:57:41 +02:00
Sylvestre Ledru
6b73ddcd12
Silent the spell checker on a test examples
2021-07-31 10:38:32 +02:00
Sylvestre Ledru
1eb3b62c46
Merge pull request #2537 from jfinkels/expand-improve-tabs-argument-2
...
expand: expand support for --tabs arguments
2021-07-31 10:33:08 +02:00
Sylvestre Ledru
638b31a877
Merge pull request #2520 from miDeb/sort/fixes
...
sort: fix some exit codes and error messages
2021-07-31 10:11:12 +02:00
Sylvestre Ledru
8620220298
Merge pull request #2511 from dezgeg/stat-t
...
stat: Support \t in --printf format
2021-07-31 09:52:42 +02:00
Sylvestre Ledru
fd02ef2dc1
Merge pull request #2516 from jfinkels/tac-read-dir-error-message
...
tac: correct error message when reading from directory
2021-07-31 09:49:54 +02:00
Sylvestre Ledru
00f6fce89d
Merge pull request #2518 from jfinkels/tac-no-line-separators-in-file
...
tac: handle no line separators in file
2021-07-31 09:44:29 +02:00
Sylvestre Ledru
938f79aebc
Merge branch 'master' into sort/fixes
2021-07-31 09:42:35 +02:00
Jeffrey Finkelstein
fb477360b2
expand: expand support for --tabs arguments
...
Add support for
* space-separated list of tab stops, like `--tabs="2 4 6"`,
* mixed comma- and space-separated lists, like `--tabs="2,4 6"`,
* the slash specifier in the last tab stop, like `--tabs=1,/5`,
* the plus specifier in the last tab stop, like `--tabs=1,+5`.
2021-07-30 23:46:02 -04:00
Michael Debertol
1bb530eebb
sort: validate input files at startup
2021-07-30 23:41:18 +02:00
Michael Debertol
a33b6d87b5
sort: open the output file at the beginning
...
This causes us to print an error message about an invalid output file
right at the start of the invocation, but *after* verifying other arguments.
2021-07-30 23:40:53 +02:00
Michael Debertol
c6e044927c
sort: print check messages to stderr, not stdout
2021-07-30 23:37:35 +02:00
Michael Debertol
891d25cebd
sort: fix exit codes and error messages
2021-07-30 23:37:35 +02:00
Michael Debertol
a214ca60bd
sort: allow null bytes for -t
2021-07-30 23:30:52 +02:00
Jeffrey Finkelstein
2648f330e4
tac: handle no line separators in file
...
Change the behavior of `tac` when there are no line separators in the
input. Previously, it was appending an extra line separator; this commit
prevents that from happening. The input is now writted directly to
stdout.
2021-07-25 15:19:29 -04:00
Jeffrey Finkelstein
abf4c69b28
tac: correct error message when reading from dir.
...
Correct the error message produced by `tac` when trying to read from a
directory. Previously if the path 'a' referred to a directory, then
running `tac a` would produce the error message
dir: read error: Invalid argument
after this commit it produces
a: read error: Invalid argument
which matches GNU `tac`.
2021-07-25 13:55:24 -04:00
Tuomas Tynkkynen
46a2491727
stat: Support \t in --printf format
2021-07-23 19:04:18 +03:00
Syukron Rifail M
37c986b005
test_du: ignore unsupported --time=birth
2021-07-19 06:55:11 +07:00
Terts Diepraam
337d257e8d
tests/sleep: fmt
2021-07-12 20:21:20 +02:00
Son Nguyen
6c26976edb
sleep: use UResult ( #2492 )
...
* sleep: use UResult in util
* sleep: add in error + test for it
* sleep: UResult - removed some verbosity
2021-07-12 20:20:23 +02:00
Sylvestre Ledru
caf984bd55
fix various clippy issues
2021-07-11 11:22:33 +02:00
Sylvestre Ledru
52c6593ef5
Merge pull request #2486 from hbina/hbina-tr-return-err-when-extra-args
...
`tr` should error out when if user provides more than 2 sets
2021-07-10 20:51:27 +02:00
Jan Scheer
30b80d0c82
tr: fix squeeze and complement with two sets ( #2485 )
2021-07-09 23:05:00 +02:00
Hanif Bin Ariffin
c4c6819dae
Reimplemented simply using args
...
Signed-off-by: Hanif Bin Ariffin <hanif.ariffin.4326@gmail.com>
2021-07-09 23:51:37 +08:00
Sylvestre Ledru
2177b8dc37
Merge pull request #2481 from Funky185540/fix/test_du_bytes_nondynamic_on_linux
...
test: du: Skip nondynamic comparison on linux for test_du_bytes
2021-07-09 09:11:52 +02:00
Jan Scheer
14b348dd4b
tests: fix tests for CICD environment
2021-07-08 11:17:18 +02:00
Jan Scheer
d59cd4fc4a
Merge branch 'master' into refactor_expected_result
2021-07-08 00:44:32 +02:00
Jan Scheer
d57f474ae1
test_whoami: refactor use expected_result and whoami from common/util.rs
2021-07-08 00:21:28 +02:00
Jan Scheer
abc59fbe85
tests/common: refactor: use TestScenario instead of util_name for expected_result()
2021-07-07 22:46:16 +02:00
Jan Scheer
31aa8b2062
test_du: refactor use expected_result from common/util.rs
2021-07-07 22:09:01 +02:00
Jan Scheer
735ec4014e
test_who: refactor use expected_result from common/util.rs
2021-07-07 17:26:59 +02:00
Jan Scheer
805e024794
test_stat: refactor use expected_result from common/util.rs
2021-07-07 15:54:03 +02:00
Jan Scheer
90de4257b1
test_pinky: refactor use expected_result from common/util.rs
2021-07-07 15:53:46 +02:00
Jan Scheer
c2bd7ae9b1
test_id: refactor use expected_result from common/util.rs
2021-07-07 15:53:26 +02:00
Jan Scheer
9631d8cf2b
test_groups: refactor use expected_result from common/util.rs
2021-07-07 15:52:56 +02:00
Sylvestre Ledru
df683f8c84
Merge pull request #2465 from miDeb/install-test
...
[: install test as [ as well
2021-07-07 15:43:38 +02:00
Jan Scheer
c447863c8d
tests/common: refactor to reduce duplicate code
...
* move fn expected_result to common/util.rs
* move fn check_coreutil_version to common/util.rs
* move fn whoami to common/util.rs
* move macro unwrap_or_return to common/macros.rs
* add documentation
* add tests
2021-07-07 14:59:14 +02:00