Skip to content

Commit 307df29

Browse files
authored
Merge pull request swiftlang#2514 from gmittert/UseAsia/Jerusalem
Use "Asia/Jerusalem" instead of "Israel"
2 parents 8e0d4b2 + a92c363 commit 307df29

File tree

1 file changed

+23
-5
lines changed

1 file changed

+23
-5
lines changed

TestFoundation/TestNSCalendar.swift

Lines changed: 23 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -371,8 +371,8 @@ class TestNSCalendar: XCTestCase {
371371
try yield(to: block, (.gregorian, "en_US", "America/Edmonton", "1906-09-01 00:33:52 -0700"))
372372
try yield(to: block, (.gregorian, "en_US", "America/Los_Angeles", "2014-09-23 20:11:39 -0800"))
373373
try yield(to: block, (.gregorian, "en_US", "America/Los_Angeles", "2016-02-29 06:30:33 -0900"))
374-
try yield(to: block, (.hebrew, "he_IL", "Israel", "2018-12-24 05:40:43 +0200"))
375-
try yield(to: block, (.hebrew, "he_IL", "Israel", "2019-03-22 09:23:26 +0200"))
374+
try yield(to: block, (.hebrew, "he_IL", "Asia/Jerusalem", "2018-12-24 05:40:43 +0200"))
375+
try yield(to: block, (.hebrew, "he_IL", "Asia/Jerusalem", "2019-03-22 09:23:26 +0200"))
376376
try yield(to: block, (.buddhist, "es_MX", "America/Cancun", "2022-10-26 23:05:34 -0500"))
377377
try yield(to: block, (.buddhist, "es_MX", "America/Cancun", "2014-10-22 07:13:00 -0500"))
378378
try yield(to: block, (.japanese, "ja_JP", "Asia/Tokyo", "2013-08-23 06:09:01 +0900"))
@@ -392,6 +392,13 @@ class TestNSCalendar: XCTestCase {
392392
try yield(to: block, (.chinese, "zh_CN", "Asia/Hong_Kong", "2019-04-12 01:12:10 +0800"))
393393
try yield(to: block, (.chinese, "zh_CN", "Asia/Hong_Kong", "2015-04-02 07:13:22 +0800"))
394394
try yield(to: block, (.chinese, "zh_CN", "Asia/Hong_Kong", "2014-10-16 06:12:10 +0800"))
395+
396+
#if !os(Windows)
397+
// TODO: these are deprecated aliases which are unavailable on Windows,
398+
// it is unclear if the support for the old names need to be validated.
399+
try yield(to: block, (.hebrew, "he_IL", "Israel", "2018-12-24 05:40:43 +0200"))
400+
try yield(to: block, (.hebrew, "he_IL", "Israel", "2019-03-22 09:23:26 +0200"))
401+
#endif
395402
}
396403

397404
func test_getEra_year_month_day_fromDate() throws {
@@ -496,8 +503,14 @@ class TestNSCalendar: XCTestCase {
496503
}
497504

498505
try yield(to: block, (.gregorian, "en_US", "America/Los_Angeles", "2013-03-26 10:04:16 -0700", "2013-03-26 00:00:00 -0700"))
506+
try yield(to: block, (.gregorian, "pt_BR", "America/Sao_Paulo", "2013-10-20 13:10:20 -0200", "2013-10-20 01:00:00 -0200")) // DST jump forward at midnight
507+
try yield(to: block, (.gregorian, "pt_BR", "America/Sao_Paulo", "2014-02-15 23:59:59 -0300", "2014-02-15 00:00:00 -0200")) // DST jump backward
508+
#if !os(Windows)
509+
// TODO: these are deprecated aliases which are unavailable on Windows,
510+
// it is unclear if the support for the old names need to be validated.
499511
try yield(to: block, (.gregorian, "pt_BR", "Brazil/East", "2013-10-20 13:10:20 -0200", "2013-10-20 01:00:00 -0200")) // DST jump forward at midnight
500512
try yield(to: block, (.gregorian, "pt_BR", "Brazil/East", "2014-02-15 23:59:59 -0300", "2014-02-15 00:00:00 -0200")) // DST jump backward
513+
#endif
501514
}
502515

503516
func test_startOfDayForDate() throws {
@@ -729,15 +742,20 @@ class TestNSCalendar: XCTestCase {
729742
try yield(to: block, (.gregorian, "en_US", "Africa/Algiers", "1971-04-24 00:00:00 +0000", "1971-04-26 00:00:00 +0100")) // suprise weekday 1
730743
try yield(to: block, (.gregorian, "en_US", "America/Toronto", "1919-03-29 00:00:00 -0500", "1919-03-31 00:30:00 -0400")) // suprise weekday 2
731744
try yield(to: block, (.gregorian, "en_US", "Europe/Madrid", "1978-04-01 00:00:00 +0100", "1978-04-03 00:00:00 +0200")) // suprise weekday 3
732-
try yield(to: block, (.hebrew, "he_IL", "Israel", "2018-03-23 00:00:00 +0200", "2018-03-25 00:00:00 +0300")) // weekend with DST jump
745+
try yield(to: block, (.hebrew, "he_IL", "Asia/Jerusalem", "2018-03-23 00:00:00 +0200", "2018-03-25 00:00:00 +0300")) // weekend with DST jump
733746
try yield(to: block, (.japanese, "ja_JP", "Asia/Tokyo", "2015-08-22 00:00:00 +0900", "2015-08-24 00:00:00 +0900")) // japanese
734747
try yield(to: block, (.persian, "ps_AF", "Asia/Kabul", "2015-03-19 00:00:00 +0430", "2015-03-21 00:00:00 +0430")) // persian
735748
try yield(to: block, (.coptic, "ar_EG", "Africa/Cairo", "2015-12-18 00:00:00 +0200", "2015-12-20 00:00:00 +0200")) // coptic
736-
try yield(to: block, (.ethiopicAmeteMihret, "am_ET", "Africa/Addis_Ababa", "2015-07-25 00:00:00 +0300", "2015-07-27 00:00:00 +0300")) // ethiopic
749+
try yield(to: block, (.ethiopicAmeteMihret, "am_ET", "Africa/Addis_Ababa", "2015-07-25 00:00:00 +0300", "2015-07-27 00:00:00 +0300")) // ethiopic
737750
try yield(to: block, (.ethiopicAmeteAlem, "am_ET", "Africa/Addis_Ababa", "2015-07-25 00:00:00 +0300", "2015-07-27 00:00:00 +0300")) // ethiopic-amete-alem
738751
try yield(to: block, (.islamic, "ar_SA", "Asia/Riyadh", "2015-05-29 00:00:00 +0300", "2015-05-31 00:00:00 +0300")) // islamic
739752
try yield(to: block, (.islamicCivil, "ar_SA", "Asia/Riyadh", "2015-05-29 00:00:00 +0300", "2015-05-31 00:00:00 +0300")) // islamic-civil
740753
try yield(to: block, (.chinese, "zh_CN", "Asia/Hong_Kong", "2015-01-03 00:00:00 +0800", "2015-01-05 00:00:00 +0800")) // chinese
754+
#if !os(Windows)
755+
// TODO: these are deprecated aliases which are unavailable on Windows,
756+
// it is unclear if the support for the old names need to be validated.
757+
try yield(to: block, (.hebrew, "he_IL", "Israel", "2018-03-23 00:00:00 +0200", "2018-03-25 00:00:00 +0300")) // weekend with DST jump
758+
#endif
741759
}
742760

743761
func test_isDateInWeekend() throws {
@@ -771,7 +789,7 @@ class TestNSCalendar: XCTestCase {
771789
func test_enumerateDatesStartingAfterDate_chineseEra_matchYearOne() throws {
772790
let calendar = try XCTUnwrap(NSCalendar(calendarIdentifier: .chinese))
773791
let locale = Locale(identifier: "zh_CN")
774-
let timeZone = try XCTUnwrap(TimeZone(identifier: "Asia/Chongqing"))
792+
let timeZone = try XCTUnwrap(TimeZone(identifier: "Asia/Shanghai"))
775793
calendar.locale = locale
776794
calendar.timeZone = timeZone
777795

0 commit comments

Comments
 (0)