1
Fork 0
mirror of https://github.com/RGBCube/uutils-coreutils synced 2025-07-28 03:27:44 +00:00

uniq: print version and help on stdout again (#6123)

* uniq: print version and help on stdout again

* uniq: format test

* uniq: replace redundant closure with fn

---------

Co-authored-by: Daniel Hofstetter <daniel.hofstetter@42dh.com>
This commit is contained in:
Terts Diepraam 2024-03-25 09:40:36 +01:00 committed by GitHub
parent e4a1455af5
commit d060134d97
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 17 additions and 3 deletions

View file

@ -18,6 +18,20 @@ fn test_invalid_arg() {
new_ucmd!().arg("--definitely-invalid").fails().code_is(1);
}
#[test]
fn test_help_and_version_on_stdout() {
new_ucmd!()
.arg("--help")
.succeeds()
.no_stderr()
.stdout_contains("Usage");
new_ucmd!()
.arg("--version")
.succeeds()
.no_stderr()
.stdout_contains("uniq");
}
#[test]
fn test_stdin_default() {
new_ucmd!()