Tests for Hungarian locale

This commit is contained in:
MegaBrutal
2026-04-06 15:10:31 +02:00
committed by Daniel Hofstetter
parent 8062daeb65
commit 0a5c60f5cf
+27
View File
@@ -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", "一月", "六月", "十二月"),
] {