xtqqczze and Daniel Hofstetter
c2acff22ee
clippy: fix items_after_statements lint
...
https://rust-lang.github.io/rust-clippy/master/index.html#items_after_statements
2026-04-28 09:37:21 +02:00
Cả thế giới là Rust and GitHub
309e3beff2
Merge pull request #9437 from naoNao89/sync-remove-unwrap
...
sync: Reset O_NONBLOCK flag after file validation to match GNU behavior
2026-01-18 18:36:17 +01:00
Laurent Cheylus
3638d6c601
pinky: fix warnings for tests on OpenBSD
...
Signed-off-by: Laurent Cheylus <foxy@free.fr >
2025-11-09 08:53:53 +01:00
Daniel Hofstetter
d2125f5378
pinky: cleanup imports in test file
2025-09-19 17:26:22 +02:00
Daniel Hofstetter
5dc7b3d3f6
pinky: move unit test away from integration tests
2025-09-19 17:13:43 +02:00
Alexander Bakanovskii
59bf18fd00
tests/pinky: add --lookup test
2025-09-19 16:21:09 +03:00
Sylvestre Ledru
a0179ea239
uutests: adjust the tests to use them
2025-03-28 21:40:31 +01:00
Sylvestre Ledru
a85539f530
Run cargo fmt on the tree
2025-03-24 21:33:12 +01:00
Sylvestre Ledru
18cb7dcf9e
Use the new function fails_with_code
...
Done with
```
$ perl -0777 -i -pe 's/([ \t]+)\.fails\(\)[ \t]*\n[ \t]+\.no_stdout\(\)[ \t]*\n[ \t]+\.code_is\(([0-9]+)\);/\1.fails_with_code(\2)\n\1.no_stdout();/gs' *rs
$ sed -i -e "s|.fails()(.*).code_is(|.fails_with_code(|g" *rs
$ perl -0777 -i -pe 's/([ \t]+)\.fails\(\)[ \t]*\n[ \t]+\.code_is\(([0-9]+)\);/\1.fails_with_code(\2);/gs' *rs
$ perl -0777 -i -pe 's/([ \t]+)\.fails\(\)(.*?)[ \t]+\.code_is\(([0-9]+)\);/\1.fails_with_code(\3)\2;/gs' *rs
...
```
2025-03-01 17:26:20 +01:00
Ben Wiederhake
c8d10ea69e
clippy: simplify code according to nightly 'manual_unwrap_or_default' lint
...
https://rust-lang.github.io/rust-clippy/master/index.html#/manual_unwrap_or_default
2024-07-18 15:59:37 +02:00
Laurent Cheylus
008dd38a0d
tests: fix warnings on OpenBSD for unused imports in by-util/test_*
...
Signed-off-by: Laurent Cheylus <foxy@free.fr >
2024-07-06 22:45:10 +02:00
Laurent Cheylus
4589f637ee
tests: disable tests for tools unsupported on OpenBSD
...
pinky, uptime and who are not supported on OpenBSD (no support of utmpx feature) => disable tests
for these tools on OpenBSD with conditional compilation
Signed-off-by: Laurent Cheylus <foxy@free.fr >
2024-01-19 17:37:45 +01:00
Terts Diepraam
c3f9e19a3b
all: normalize license notice in all *.rs files
2023-08-24 12:21:09 +02:00
Daniel Hofstetter
7a888da409
tests: remove all "extern crate" statements
2023-04-10 08:31:31 +02:00
Daniel Hofstetter
6988eb7ec6
tests: expand wildcard imports
2023-03-20 15:32:35 +01:00
Daniel Hofstetter
f6b646e4e5
clippy: fix warnings introduced with Rust 1.67.0
2023-01-27 17:37:56 +01:00
Daniel Hofstetter
9a2174ba02
chore: standardize creation of empty strings
2022-12-01 13:49:23 +01:00
Terts Diepraam
9177cb7b24
all: add tests for usage error exit code
2022-09-10 20:59:42 +02:00
Justin Tracey and Sylvestre Ledru
5e7d58650d
fix null pointer derefs
...
The code for creating a Passwd from the fields of the raw syscall result
assumed that the syscall would return valid C strings in all non-error
cases. This is not true, and at least one platform (Android) will
populate the fields with null pointers where they are not supported.
To fix this and prevent the error from happening again, this commit
changes `cstr2string(ptr)` to check for a null pointer, and return an
`Option<String>`, with `None` being the null pointer case. While
arguably it should be the caller's job to check for a null pointer
before calling (since the safety precondition is that the pointer is to
a valid C string), relying on the type checker to force remembering this
edge case is safer in the long run.
2022-04-20 08:44:49 +02:00
Justin Tracey
f52f655934
pinky: improve tests
2022-03-07 12:32:07 -05:00
Daniel Eades
f2074140ec
use 'char' instead of 'str' for single character patterns
2022-01-30 14:01:21 +01:00
Terts Diepraam
c39a9b49d4
pinky: clap 3
2022-01-11 19:16:48 +01:00
Jan Verbeek
f2ddae93fa
uucore::entries: Make Passwd::locate and Group::locate thread-safe
2021-11-26 14:48:33 +01: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
735ec4014e
test_who: refactor use expected_result from common/util.rs
2021-07-07 17:26:59 +02:00