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

date: Catch format string that is not supported by chrono (#4244)

* Catch format string that is not supported by chrono

Co-authored-by: Sylvestre Ledru <sylvestre@debian.org>
This commit is contained in:
jaggededgedjustice 2023-05-27 14:41:12 +01:00 committed by GitHub
parent 76656aa2c6
commit 81a854a13e
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 14 additions and 0 deletions

View file

@ -356,6 +356,13 @@ fn test_invalid_format_string() {
assert!(result.stderr_str().starts_with("date: invalid format "));
}
#[test]
fn test_unsupported_format() {
let result = new_ucmd!().arg("+%#z").fails();
result.no_stdout();
assert!(result.stderr_str().starts_with("date: invalid format %#z"));
}
#[test]
fn test_date_string_human() {
let date_formats = vec![