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

Merge pull request #4526 from tertsdiepraam/date-d-should-return-1

`date`: make sure 'invalid date' message also returns exit code 1
This commit is contained in:
Daniel Hofstetter 2023-03-18 07:08:04 +01:00 committed by GitHub
commit 882a35c3b6
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 15 additions and 2 deletions

View file

@ -300,3 +300,13 @@ fn test_invalid_format_string() {
result.no_stdout();
assert!(result.stderr_str().starts_with("date: invalid format "));
}
#[test]
fn test_invalid_date_string() {
new_ucmd!()
.arg("-d")
.arg("foo")
.fails()
.no_stdout()
.stderr_contains("invalid date");
}