From 19e08d5c112ee633216873f616546689780be4d2 Mon Sep 17 00:00:00 2001 From: Nicolas Boichat Date: Mon, 28 Apr 2025 16:39:18 +0800 Subject: [PATCH] test_date: Add test for quarter This was fixed upstream in #7333, but it's a good idea to have a test here as well, especially as we're considering switching datetime library. --- tests/by-util/test_date.rs | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/tests/by-util/test_date.rs b/tests/by-util/test_date.rs index f0d7e8395..9371a9477 100644 --- a/tests/by-util/test_date.rs +++ b/tests/by-util/test_date.rs @@ -169,6 +169,14 @@ fn test_date_format_y() { scene.ucmd().arg("+%y").succeeds().stdout_matches(&re); } +#[test] +fn test_date_format_q() { + let scene = TestScenario::new(util_name!()); + + let re = Regex::new(r"^[1-4]\n$").unwrap(); + scene.ucmd().arg("+%q").succeeds().stdout_matches(&re); +} + #[test] fn test_date_format_m() { let scene = TestScenario::new(util_name!());