@@ -1187,3 +1187,33 @@ def test_issue_1089():
11871187def test_issue_1162 (locale , format , negative , expected ):
11881188 delta = timedelta (seconds = 10800 ) * (- 1 if negative else + 1 )
11891189 assert dates .format_timedelta (delta , add_direction = True , format = format , locale = locale ) == expected
1190+
1191+
1192+ def test_issue_1192 ():
1193+ # The actual returned value here is not actually strictly specified ("get_timezone_name"
1194+ # is not an operation specified as such). Issue #1192 concerned this invocation returning
1195+ # the invalid "no inheritance marker" value; _that_ should never be returned here.
1196+ # IOW, if the below "Hawaii-Aleutian Time" changes with e.g. CLDR updates, that's fine.
1197+ assert dates .get_timezone_name ('Pacific/Honolulu' , 'short' , locale = 'en_GB' ) == "Hawaii-Aleutian Time"
1198+
1199+
1200+ @pytest .mark .xfail
1201+ def test_issue_1192_fmt (timezone_getter ):
1202+ """
1203+ There is an issue in how we format the fallback for z/zz in the absence of data
1204+ (esp. with the no inheritance marker present).
1205+ This test is marked xfail until that's fixed.
1206+ """
1207+ # env TEST_TIMEZONES=Pacific/Honolulu TEST_LOCALES=en_US,en_GB TEST_TIME_FORMAT="YYYY-MM-dd H:mm z" bin/icu4c_date_format
1208+ # Defaulting TEST_TIME to 2025-03-04T13:53:00Z
1209+ # Pacific/Honolulu en_US 2025-03-04 3:53 HST
1210+ # Pacific/Honolulu en_GB 2025-03-04 3:53 GMT-10
1211+ # env TEST_TIMEZONES=Pacific/Honolulu TEST_LOCALES=en_US,en_GB TEST_TIME_FORMAT="YYYY-MM-dd H:mm zz" bin/icu4c_date_format
1212+ # Pacific/Honolulu en_US 2025-03-04 3:53 HST
1213+ # Pacific/Honolulu en_GB 2025-03-04 3:53 GMT-10
1214+ tz = timezone_getter ("Pacific/Honolulu" )
1215+ dt = _localize (tz , datetime (2025 , 3 , 4 , 13 , 53 , tzinfo = UTC ))
1216+ assert dates .format_datetime (dt , "YYYY-MM-dd H:mm z" , locale = "en_US" ) == "2025-03-04 3:53 HST"
1217+ assert dates .format_datetime (dt , "YYYY-MM-dd H:mm z" , locale = "en_GB" ) == "2025-03-04 3:53 GMT-10"
1218+ assert dates .format_datetime (dt , "YYYY-MM-dd H:mm zz" , locale = "en_US" ) == "2025-03-04 3:53 HST"
1219+ assert dates .format_datetime (dt , "YYYY-MM-dd H:mm zz" , locale = "en_GB" ) == "2025-03-04 3:53 GMT-10"
0 commit comments