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

tests(date): Add tests for #6392

These tests check that days and month with a single digit are correctly handled.
This commit is contained in:
Dorian Péron 2024-06-15 13:18:18 +02:00
parent 256b2ded82
commit e4f89761a7

View file

@ -420,6 +420,21 @@ fn test_invalid_date_string() {
.stderr_contains("invalid date");
}
#[test]
fn test_date_one_digit_date() {
new_ucmd!()
.arg("-d")
.arg("2000-1-1")
.succeeds()
.stdout_contains("Sat Jan 1 00:00:00 2000");
new_ucmd!()
.arg("-d")
.arg("2000-1-4")
.succeeds()
.stdout_contains("Tue Jan 4 00:00:00 2000");
}
#[test]
fn test_date_overflow() {
new_ucmd!()