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

date: Catch panic from invalid format string (#4240)

* Catch panic from invalid date string
This commit is contained in:
jaggededgedjustice 2022-12-25 20:11:34 +00:00 committed by GitHub
parent 083e4ac4df
commit b8a755a396
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 21 additions and 1 deletions

View file

@ -225,3 +225,10 @@ fn test_date_set_valid_4() {
assert!(result.stderr_str().starts_with("date: invalid date "));
}
}
#[test]
fn test_invalid_format_string() {
let result = new_ucmd!().arg("+%!").fails();
result.no_stdout();
assert!(result.stderr_str().starts_with("date: invalid format "));
}