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:
parent
083e4ac4df
commit
b8a755a396
2 changed files with 21 additions and 1 deletions
|
@ -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 "));
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue