From b17129d8ee50b83001092d75d8abd23cbff04579 Mon Sep 17 00:00:00 2001 From: Sylvestre Ledru Date: Sat, 25 Oct 2025 21:21:12 +0200 Subject: [PATCH] date: add ignored tests that passes with GNU and fails with Rust --- tests/by-util/test_date.rs | 38 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 38 insertions(+) diff --git a/tests/by-util/test_date.rs b/tests/by-util/test_date.rs index eb7a5e0fc..c3e7a132d 100644 --- a/tests/by-util/test_date.rs +++ b/tests/by-util/test_date.rs @@ -944,3 +944,41 @@ fn test_date_tz_abbreviation_unknown() { .fails() .stderr_contains("invalid date"); } + +#[test] +#[ignore = "we reject 'J', GNU treats as midnight"] +fn test_date_fuzz_military_timezone_j() { + // J is reserved for local time in military timezones + // GNU date treats it as midnight, we reject it + new_ucmd!() + .env("TZ", "UTC+1") + .arg("-d") + .arg("J") + .arg("+%F %T %Z") + .succeeds() + .stdout_contains("00:00:00"); +} + +#[test] +#[ignore = "we use current time, GNU uses midnight"] +fn test_date_fuzz_empty_string() { + // Empty string should be treated as midnight today + new_ucmd!() + .env("TZ", "UTC+1") + .arg("-d") + .arg("") + .succeeds() + .stdout_contains("00:00:00"); +} + +#[test] +#[ignore = "we produce year 0008, GNU gives today 12:00"] +fn test_date_fuzz_relative_m9() { + // Relative date string "m9" should be parsed correctly + new_ucmd!() + .env("TZ", "UTC+9") + .arg("-d") + .arg("m9") + .succeeds() + .stdout_contains("12:00:00"); +}