Commit graph

1057 commits

Author SHA1 Message Date
Sylvestre Ledru d40fc65ee6
Merge branch 'master' into numfmt/round-and-c-locale 2021-06-23 12:39:55 +02:00
Sylvestre Ledru a73e71ba74
Merge pull request #2437 from miDeb/cp/reflink-auto
cp: default to --reflink=auto on linux and macos
2021-06-23 12:37:44 +02:00
Sylvestre Ledru 87eaf6e80a
Merge pull request #2447 from jhscheer/locale_c
fix some issues with locale (replace "LANGUAGE" with "LC_ALL")
2021-06-23 12:36:40 +02:00
Jan Scheer c0be979611 fix some issues with locale (replace "LANGUAGE" with "LC_ALL")
`LANGUAGE=C` is not enough, `LC_ALL=C` is needed as the environment
variable that overrides all the other localization settings.

e.g.
```bash
$ LANGUAGE=C id foobar
id: ‘foobar’: no such user

$ LC_ALL=C id foobar
id: 'foobar': no such user
```

* replace `LANGUAGE` with `LC_ALL` as environment variable in the tests
* fix the the date string of affected uutils
* replace `‘` and `’` with `'`
2021-06-23 11:30:28 +02:00
Sylvestre Ledru 178399c20e
Merge pull request #2449 from miDeb/temp-win
Make tests pass on a windows VM
2021-06-23 08:40:30 +02:00
Michael Debertol ce0801db90 tests/mv: test uutils mv instead of system util
Calling `cmd_keepenv("mv")` spawned the system `mv` instead of
the uutils `mv`. Also, `keepenv` isn't necessary because it doesn't
need to inherit environment variables.
We now actually check the stderr, because previously the result of
`ends_with` was not used, making the test pass even when it shouldn't.

I disabled the test on windows because `mkdir` does not support `-m` on
windows, making the test fail because there will be no permission error.
On FreeBSD there isn't a permission error either, and `mv` succeeds.
2021-06-23 00:58:19 +02:00
Michael Debertol 622504467f mktemp: note that windows uses a different env var for tmpdir
On windows `std::env::temp_dir` uses the `TMP` environment variable
instead of `TMPDIR`.
2021-06-22 17:44:45 +02:00
Michael Debertol e5a7bcbb9d tests: keep env vars for the temporary directory
On some Windows machines this would otherwise cause `std::env::temp_dir`
to fall back to a path that is not writeable (C:\\Windows).
Since by default integration tests don't inherit env vars from the
parent, we have to override this in some cases.
2021-06-22 17:43:46 +02:00
Sylvestre Ledru e48ff9dd9e
Merge pull request #2441 from siebenHeaven/ls_dangling_symlinks
ls: Fix problems dealing with dangling symlinks
2021-06-21 22:34:15 +02:00
Sylvestre Ledru 2f11a23016
Merge pull request #2431 from miDeb/pr/races
tests/pr: include one more possible minute
2021-06-21 22:30:37 +02:00
Anup Mahindre ffb6b7152f tests: Fix ls dangling symbolic links test output for windows
On windows we do not print inode numbers at all, so skip checking for ?
for dangling symbolic links in expected output
2021-06-20 16:58:28 +05:30
Anup Mahindre d0039df8c3 tests: Add test for dangling symlinks with ls
Add test similar to gnu dangling symlinks test
2021-06-20 13:50:38 +05:30
Roy Ivy III f5edc500e0 tests ~ fix spelling errors 2021-06-19 18:40:22 -05:00
Terts Diepraam 3086e95702 numfmt: add round and use C locale style for errors 2021-06-20 00:21:14 +02:00
Sylvestre Ledru 115eb5eb52
Merge pull request #2432 from dezgeg/test-bracket-syntax
test: Implement [ expr ] syntax
2021-06-19 19:14:20 +02:00
Michael Debertol 9fb927aa85 cp: always delete the destination for symlinks 2021-06-19 18:59:57 +02:00
Tuomas Tynkkynen 7b9814c778 test: Implement [ expr ] syntax
When invoked via '[' name, last argument must be ']' or we bail out with
syntax error. Then the trailing ']' is simply disregarded and processing
happens like usual.
2021-06-19 18:49:21 +03:00
Sylvestre Ledru 5ba69d4a35
Merge pull request #2412 from syukronrm/du-dereference
du: add `--dereference`
2021-06-19 12:05:18 +02:00
Sylvestre Ledru ac98960f32
Merge pull request #2427 from miDeb/ln/recursive-relative
ln: don't return an empty path in `relative_path`
2021-06-19 12:03:59 +02:00
Sylvestre Ledru e2a00b67ed
Merge pull request #2428 from jhscheer/cut_2424
cut: fix `-d=` (#2424)
2021-06-19 08:46:42 +02:00
Michael Debertol 285eeac1fb tests/pr: include one more possible minute 2021-06-18 18:49:39 +02:00
Terts Diepraam f1e043ca1b
Merge pull request #2361 from jhscheer/id_zero_2351
id: revamp to pass more of GNU's Testsuite
2021-06-18 18:10:49 +02:00
Terts Diepraam e273cb8e4f
Merge pull request #2426 from miDeb/cp/symlinks
cp: improve symlink handling
2021-06-18 17:27:50 +02:00
Jan Scheer 65f47be5ee cut: fix -d= (#2424) 2021-06-18 12:10:40 +02:00
Michael Debertol 3d3af5c8ca ln: don't return an empty path in relative_path 2021-06-18 11:53:29 +02:00
Tuomas Tynkkynen d05964a8cb test: Implement -k
parser.rs already accepts this, finish the implementation.
2021-06-18 00:03:08 +03:00
Michael Debertol 12a1c87cb8 cp: improve symlink handling 2021-06-17 22:26:13 +02:00
Terts Diepraam 439b7e0ca5
Merge pull request #2415 from miDeb/touch/date-epoch
touch: support @<timestamp> date format
2021-06-17 10:36:03 +02:00
Syukron Rifail M bc8415c9db du: add --dereference 2021-06-17 14:06:41 +07:00
Michael Debertol 816c55dce4 sort: avoid sigpipe errors
By calling `unwrap` we get a panic instead of an abort, and since we
mute sigpipe panics for all utilites, no error message will be printed.
2021-06-17 00:06:39 +02:00
Terts Diepraam ce6d439a1b
Merge pull request #2381 from miDeb/sort/merge-improvements
sort: delete temporary files as soon as possible
2021-06-17 00:00:59 +02:00
Jan Scheer 39aa5312ed id/tests: skip tests for multiple_user feature if there's not at least coreutils id version 8.31 in $PATH 2021-06-16 23:52:55 +02:00
Jan Scheer 88367c6fb4 Merge branch 'fix_getgrouplist' into id_zero_2351 2021-06-16 19:20:34 +02:00
Jan Scheer 54cbb69d37 id/tests: fix tests if run on macOS 2021-06-16 19:16:29 +02:00
Michael Debertol 4c5ee1dbd7 tty: correct exit code for write errrors 2021-06-16 17:55:48 +02:00
Michael Debertol aeaf2cebfb tests/tty: fix test inputs
calling `pipe_in("</dev/null")` does not pipe in the `/dev/null` file,
but the raw string "</dev/null".

Closes https://github.com/uutils/coreutils/issues/2301
2021-06-16 17:43:49 +02:00
Hanif Bin Ariffin 23de181171 Added tests for cp --preserve without args
Signed-off-by: Hanif Bin Ariffin <hanif.ariffin.4326@gmail.com>
2021-06-16 11:32:15 +08:00
Michael Debertol 84affa2137 touch: support @<timestamp> date format
parse `@<seconds since epoch>` as a valid date.
2021-06-15 22:43:40 +02:00
Michael Debertol d4914b6943 sort: add a test for --batch-size 2021-06-15 19:09:22 +02:00
Daniel Rocco 22fbf16b2c test: implement user, group ownership checks
closes #2337
2021-06-14 14:30:17 -04:00
Terts Diepraam 553f70b06a
Merge pull request #2408 from Foryah/issue-2346
touch: change the error message to match the GNU error message #2346
2021-06-14 13:43:44 +02:00
David Suilea 25240ba61c
touch: change the error message to match the GNU error message #2346 2021-06-14 13:03:14 +02:00
Terts Diepraam dfe0314d8d
Merge pull request #2397 from miDeb/sort/args
sort: refactor command line arguments
2021-06-14 12:49:19 +02:00
Terts Diepraam 05c8883b1a
Merge pull request #2395 from miDeb/timeout/cmd-args
timeout: handle arguments for the command to run
2021-06-14 12:01:31 +02:00
Terts Diepraam b6f27a9a63
Merge pull request #2358 from siebenHeaven/du_threshold
Implement du threshold argument handling
2021-06-14 10:58:30 +02:00
Jan Scheer 052202ca19 Merge branch 'master' into id_zero_2351 2021-06-13 11:30:43 +02:00
Jan Scheer 17c6f4c13a id: add more tests to be consistent with GNU testsuite tests (tests/id/zero.sh) 2021-06-13 11:11:04 +02:00
Michael Debertol d8c8e6774f tests/pr: formatting 2021-06-12 18:03:00 +02:00
Michael Debertol bb029193e2 tests/pr: prevent races
Allow any timestamp from the start of the command to its end to show up
in stdout.
2021-06-12 18:03:00 +02:00
Michael Debertol 98088db9ff tests: add _any functions
This should make it easier to write tests that could have different
valid outputs depending on timing.
2021-06-12 18:03:00 +02:00