From 0a5c60f5cf2f2e9f0e5889e6759f2438433b3b17 Mon Sep 17 00:00:00 2001 From: MegaBrutal Date: Thu, 12 Mar 2026 23:45:00 +0100 Subject: [PATCH] Tests for Hungarian locale --- tests/by-util/test_date.rs | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) diff --git a/tests/by-util/test_date.rs b/tests/by-util/test_date.rs index 3b8bd13f8..489f15158 100644 --- a/tests/by-util/test_date.rs +++ b/tests/by-util/test_date.rs @@ -1622,6 +1622,32 @@ fn test_date_locale_en_us_vs_c_difference() { } } +#[test] +#[cfg(unix)] +fn test_date_locale_hu_hungarian() { + // Regression test for uutils/coreutils#11240: the GNU modifier fast-path + // ("%-e") used to run before ICU localization, so "%b"/"%A" came out in + // English even under hu_HU.UTF-8. Pin an explicit format string so the + // assertion is deterministic across glibc versions (the default D_T_FMT + // for hu_HU differs between distros). + if !is_locale_available("hu_HU.UTF-8") { + return; + } + + let result = new_ucmd!() + .env("LC_ALL", "hu_HU.UTF-8") + .env("TZ", "UTC") + .arg("-d") + .arg("2025-12-14T13:00:00") + .arg("+%Y. %b %-e., %A, %H:%M:%S %Z") + .succeeds(); + + assert_eq!( + result.stdout_str(), + "2025. dec 14., vasárnap, 13:00:00 UTC\n" + ); +} + #[test] #[cfg(any(target_os = "linux", target_os = "android", target_vendor = "apple"))] fn test_date_locale_fr_french() { @@ -2273,6 +2299,7 @@ fn test_locale_month_names() { ("es_ES.UTF-8", "enero", "junio", "diciembre"), ("it_IT.UTF-8", "gennaio", "giugno", "dicembre"), ("pt_BR.UTF-8", "janeiro", "junho", "dezembro"), + ("hu_HU.UTF-8", "január", "június", "december"), ("ja_JP.UTF-8", "1月", "6月", "12月"), ("zh_CN.UTF-8", "一月", "六月", "十二月"), ] {