Hello

The attached patch improved the date tests with other locales with different calendars!

Cheers,

Sylvestre

From 053437b01906582c4d8776bd35854a221fe73713 Mon Sep 17 00:00:00 2001
From: Sylvestre Ledru <[email protected]>
Date: Sat, 24 Jan 2026 11:21:25 +0100
Subject: [PATCH] tests: date: verify localized weekday and month format

* tests/date/: Ensure proper localized text output.
---
 tests/date/date-ethiopia.sh | 7 +++++++
 tests/date/date-iran.sh     | 7 +++++++
 tests/date/date-thailand.sh | 7 +++++++
 3 files changed, 21 insertions(+)

diff --git a/tests/date/date-ethiopia.sh b/tests/date/date-ethiopia.sh
index f4c70d05b..ef26a5121 100755
--- a/tests/date/date-ethiopia.sh
+++ b/tests/date/date-ethiopia.sh
@@ -38,6 +38,13 @@ test $year_september_10 = $(($year_september_12 - 1)) || fail=1
 test $year_september_10 = $(($current_year - 8)) || fail=1
 test $year_september_12 = $(($current_year - 7)) || fail=1
 
+# Verify Amharic weekday and month formatting with specific date (2025-03-21)
+specific_date="2025-03-21"
+date_format=$(LC_TIME=am_ET.UTF-8 date -d "$specific_date" "+%A %a %b %B")
+
+# Verify we get Amharic text for Friday and March: "ዓርብ ዓርብ መጋ መጋቢት"
+test "$date_format" = "ዓርብ ዓርብ መጋ መጋቢት" || fail=1
+
 # Check that --iso-8601 and --rfc-3339 uses the Gregorian calendar.
 case $(date --iso-8601=hours) in $current_year-*) ;; *) fail=1 ;; esac
 case $(date --rfc-3339=date) in $current_year-*) ;; *) fail=1 ;; esac
diff --git a/tests/date/date-iran.sh b/tests/date/date-iran.sh
index cb30e18b5..a8894a8f8 100755
--- a/tests/date/date-iran.sh
+++ b/tests/date/date-iran.sh
@@ -38,6 +38,13 @@ test $year_march_19 = $(($year_march_22 - 1)) || fail=1
 test $year_march_19 = $(($current_year - 622)) || fail=1
 test $year_march_22 = $(($current_year - 621)) || fail=1
 
+# Verify Persian weekday and month formatting with specific date (2025-03-21)
+specific_date="2025-03-21"
+date_format=$(LC_TIME=fa_IR.UTF-8 date -d "$specific_date" "+%A %a %b %B")
+
+# Verify we get Persian text for Friday and March: "جمعه جمعه فروردین فروردین"
+test "$date_format" = "جمعه جمعه فروردین فروردین" || fail=1
+
 # Check that --iso-8601 and --rfc-3339 uses the Gregorian calendar.
 case $(date --iso-8601=hours) in $current_year-*) ;; *) fail=1 ;; esac
 case $(date --rfc-3339=date) in $current_year-*) ;; *) fail=1 ;; esac
diff --git a/tests/date/date-thailand.sh b/tests/date/date-thailand.sh
index 20d9871a8..5c7be7c9f 100755
--- a/tests/date/date-thailand.sh
+++ b/tests/date/date-thailand.sh
@@ -39,6 +39,13 @@ for month in 01 03 05 07 08 10 12; do
   date --date=$current_year-$month-01 +%B | grep "$days_31_suffix$" || fail=1
 done
 
+# Verify Thai weekday and month formatting with specific date (2025-03-21)
+specific_date="2025-03-21"
+date_format=$(LC_TIME=th_TH.UTF-8 date -d "$specific_date" "+%A %a %b %B")
+
+# Verify we get Thai text for Friday and March: "ศุกร์ ศ. มี.ค. มีนาคม"
+test "$date_format" = "ศุกร์ ศ. มี.ค. มีนาคม" || fail=1
+
 # Check that --iso-8601 and --rfc-3339 uses the Gregorian calendar.
 case $(date --iso-8601=hours) in $current_year-*) ;; *) fail=1 ;; esac
 case $(date --rfc-3339=date) in $current_year-*) ;; *) fail=1 ;; esac
-- 
2.47.3

Reply via email to