Commit graph

1321 commits

Author SHA1 Message Date
Sylvestre Ledru
c43436d50a
Merge pull request #2710 from jfinkels/tests-add-missing-assert-placeholder
tests: add template string to assert! statements
2021-10-19 20:53:35 +02:00
Jan Scheer
bfa8a2a068
tests/util: add more wrappers for common file handling tasks
truncate, rename, remove, copy, rmdir, etc.
2021-10-19 01:12:12 +02:00
Jeffrey Finkelstein
9e21d26b7c tests: add template string to assert! statements
Add missing "{}" template strings to `assert!()` statements.
2021-10-11 16:51:14 -04:00
Sylvestre Ledru
11ca4be1aa
Merge pull request #2707 from sylvestre/more-clippy
More clippy fixes
2021-10-10 12:46:35 +02:00
Sylvestre Ledru
51613c02ec add a word to ignore... 2021-10-10 12:16:01 +02:00
Sylvestre Ledru
00de952592 Fix various 'if_then_panic' clippy warnings 2021-10-10 09:57:39 +02:00
Jan Scheer
3e985cb029
Merge branch 'master' into fix_chroot_2687 2021-10-10 01:04:25 +02:00
Sylvestre Ledru
03a037e8ea
Merge pull request #2701 from vulppine/seq-hex
seq: Adds hexadecimal integer parsing
2021-10-09 11:01:42 +02:00
vulppine
cddd40b4e1 seq: Updates hex parse readability, adds hex test 2021-10-05 18:41:28 -07:00
vulppine
4e1f945e86 seq: Adds testing for large hex numbers 2021-10-03 09:50:49 -07:00
Thomas Queiroz
f85ccf8e46
tests/base64: update test 2021-10-02 23:16:07 -03:00
Thomas Queiroz
051284de4c
tests/base32: update test 2021-10-02 23:12:42 -03:00
vulppine
aad0682a40 seq: Adds testing for hexadecimal integer parsing 2021-10-02 08:46:09 -07:00
Sylvestre Ledru
b2fa51ddd9
Merge pull request #2656 from jhscheer/ls_selinux
`ls`: add support for showing SELinux context (--context/-Z)
2021-10-02 12:56:09 +02:00
Sylvestre Ledru
fb5650951e
Merge pull request #2696 from jhscheer/fix_check_coreutil_version
common/util: fix parsing of coreutil version
2021-10-02 09:03:23 +02:00
Jan Scheer
e9371dc57d
common/util: fix parsing of coreutil version
For the CICD on macOS, this fixes:

```
---- common::util::tests::test_check_coreutil_version stdout ----
---- common::util::tests::test_expected_result stdout ----
thread 'common::util::tests::test_expected_result' panicked at
'byte index 4 is out of bounds of `9.0`', tests/common/util.rs:1172:41
```
2021-10-02 00:58:04 +02:00
Sylvestre Ledru
01d098993b
Merge pull request #2662 from Smicry/master
add kill -l final new line #2644
2021-09-29 09:58:50 +02:00
Jan Scheer
30c8a43788
test_chroot: add comments 2021-09-22 13:53:57 +02:00
Jan Scheer
8db8d8ac4e
chroot: add 'test_default_shell` 2021-09-19 22:21:29 +02:00
Sylvestre Ledru
8d418cd61c
Merge pull request #2672 from oeble/kill_with_signal_name
Kill with signal name
2021-09-18 22:55:27 +02:00
Sylvestre Ledru
3e8b4045c8
Merge pull request #2675 from blyxxyz/whoami-cleanup
whoami: Cleanup
2021-09-18 17:20:09 +02:00
Jan Verbeek
7ea2bfbe26 seq: replace loops with a single format string
Replace two loops that print leading and trailing 0s when printing a
number in fixed-width mode with a single call to `write!()` with the
appropriate formatting parameters.
2021-09-18 10:27:03 -04:00
Jeffrey Finkelstein
bfb1327ad4 seq: use print_seq_integers() regardless of last
Ensure that the `print_seq_integers()` function is called when the first
number and the increment are integers, regardless of the type of the
last value specified.
2021-09-18 10:27:03 -04:00
Sylvestre Ledru
7fb1fcfac5
Merge pull request #2686 from jfinkels/hashsum-window-text-mode
hashsum: add tests for Windows text mode
2021-09-18 09:16:48 +02:00
Jeffrey Finkelstein
2ac5dc0a70 seq: compute correct width for scientific notation
Change the way `seq` computes the number of digits needed to print a
number so that it works for inputs given in scientific notation.
Specifically, this commit parses the input string to determine whether
it is an integer, a float in decimal notation, or a float in scientific
notation, and then computes the number of integral digits and the number
of fractional digits based on that. This also supports floating point
negative zero, expressed in both decimal and scientific notation.
2021-09-17 23:49:54 -04:00
Jeffrey Finkelstein
cd5f676903 hashsum: add tests for Windows text mode 2021-09-17 21:24:43 -04:00
Jan Scheer
79d838b1c3
Merge branch 'master' into ls_selinux 2021-09-17 14:14:47 +02:00
Smicry
89428a77f3 fix kill list final new line test 2021-09-14 23:56:08 +08:00
Jan Verbeek
0a3785bf84 whoami: Run tests on Windows 2021-09-14 14:13:58 +02:00
Jeffrey Finkelstein
60025800c3 seq: trim leading whitespace from inputs 2021-09-13 21:46:17 -04:00
Michael Debertol
5d7e7ed4c0
Merge pull request #2651 from jhscheer/ls_small_fix_for_test_from_2627
test_ls: add features for uutils called by ccmd
2021-09-13 18:35:32 +02:00
Michael Debertol
570f23ac90
Merge pull request #2647 from jfinkels/seq-test-inf
seq: use stdout.write_all() instead of print!()
2021-09-13 18:34:24 +02:00
Michael Debertol
5faa4c41db
Merge pull request #2607 from jfinkels/tac-regex
tac: add support for --regex option to tac
2021-09-13 18:12:57 +02:00
Sylvestre Ledru
7712fd02f2
Merge pull request #2670 from sylvestre/freebsd3
Fixed a warning on freebdsd
2021-09-13 18:09:00 +02:00
Jan Scheer
4dc6536bb9
Merge branch 'master' into ls_selinux 2021-09-13 13:42:51 +02:00
Jan Scheer
cd2153eac6
ls: (--context/-Z) add support for invalid utf8
If security context byte slice contains invalid utf8:
* issue warning
* show replacement characters for invalid utf8 sequences
2021-09-13 13:24:44 +02:00
Sylvestre Ledru
450a3faf9f
Add to the spell ignore list 2021-09-13 12:29:28 +02:00
Jan Scheer
deedb73bcb
tests/common: make call to host_name_for idempotent
This fixes an issue on macOS/bsd where multiple calls
to `host_name_for` each added a prefix 'g'.
The issue led to some tests being skipped because `util_name` was
renamed to e.g. "ggid" instead of "gid".
2021-09-13 12:28:47 +02:00
Smicry
db21fef95d fix kill list final new line test 2021-09-13 09:27:14 +08:00
Sylvestre Ledru
cc8522a2db Fixed a warning on freebdsd:
warning: unused import: `std::os::unix::fs::PermissionsExt`
2021-09-12 23:14:34 +02:00
Smicry
7d445612a2 add kill list final new line test 2021-09-13 00:15:53 +08:00
Jeffrey Finkelstein
664c7a6ec5 tac: add support for --regex option to tac
Add support for `tac --regex`, where the line separator is interpreted
as a regular expression.
2021-09-11 22:54:55 -04:00
Olivier EBLÉ
872c0fac1d
tests/kill: test old form args with signal name
Add two tests of the old form signal arg using the signal name instead
of the number.

Bonus: add a test for the new form but with the prefix SIG-
2021-09-11 22:37:55 +02:00
Jan Scheer
e018a45b54
test_ls: add/adjust tests for SELinux context 2021-09-11 04:13:30 +02:00
Jeffrey Finkelstein
96b8616a1a seq: use stdout.write_all() instead of print!()
Change from using `print!()` to using `stdout.write_all()` in order to
allow the main function to handle broken pipe errors gracefully.
2021-09-10 20:00:26 -04:00
Jan Verbeek
b7d697753c unlink: Simplify, remove unsafe, move to core
This makes it no longer possible to pass multiple filenames, but every
other implementation I tried (GNU, busybox, FreeBSD, sbase) also
forbids that so I think it's for the best.
2021-09-10 21:50:38 +02:00
Jan Verbeek
8f901ee860 tty: Make test_stdout_fail() less flaky 2021-09-10 19:29:27 +02:00
Jan Scheer
46fc91af19
test_ls: add features for uutils called by ccmd 2021-09-10 18:36:51 +02:00
Sylvestre Ledru
75e5c42e40
chown: support '.' as 'user.group' separator (like ':') (#2638)
* chown: support '.' as 'user.group' separator (like ':')

It also manages the case:
user.name:group (valid too)

Should fix:
gnu/tests/chown/separator.sh
2021-09-10 08:15:23 +02:00
Sylvestre Ledru
ed258e3c9c
touch: add --ref as an alias (#2641) 2021-09-09 21:48:17 +02:00