Skip to content

Commit ee87339

Browse files
committed
Update GregorianCalendarInternationalizationTests to avoid using the default timezone
1 parent 9fad9ad commit ee87339

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

Tests/FoundationInternationalizationTests/GegorianCalendarInternationalizationTests.swift

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ import Testing
2323
@Suite("Gregorian Calendar (Internationalization)")
2424
private struct GregorianCalendarInternationalizationTests {
2525
@Test func copy() {
26-
let gregorianCalendar = _CalendarGregorian(identifier: .gregorian, timeZone: nil, locale: nil, firstWeekday: 5, minimumDaysInFirstWeek: 3, gregorianStartDate: nil)
26+
let gregorianCalendar = _CalendarGregorian(identifier: .gregorian, timeZone: .gmt, locale: nil, firstWeekday: 5, minimumDaysInFirstWeek: 3, gregorianStartDate: nil)
2727

2828
let newLocale = Locale(identifier: "new locale")
2929
let tz = TimeZone(identifier: "America/Los_Angeles")!
@@ -35,7 +35,7 @@ private struct GregorianCalendarInternationalizationTests {
3535
#expect(copied.firstWeekday == 5)
3636
#expect(copied.minimumDaysInFirstWeek == 3)
3737

38-
let copied2 = gregorianCalendar.copy(changingLocale: nil, changingTimeZone: nil, changingFirstWeekday: 1, changingMinimumDaysInFirstWeek: 1)
38+
let copied2 = gregorianCalendar.copy(changingLocale: nil, changingTimeZone: .gmt, changingFirstWeekday: 1, changingMinimumDaysInFirstWeek: 1)
3939

4040
// unset values stay the same
4141
#expect(copied2.locale == gregorianCalendar.locale)
@@ -2464,7 +2464,7 @@ private struct GregorianCalendarInternationalizationTests {
24642464
// expect local time in dc.timeZone (UTC+8)
24652465
#expect(gregorianCalendar.date(from: dc_customTimeZone)! == Date(timeIntervalSinceReferenceDate: 679024975.891)) // 2022-07-09T02:02:55Z
24662466

2467-
let dcCalendar_noTimeZone = Calendar(identifier: .japanese, locale: Locale(identifier: ""), timeZone: nil, firstWeekday: 1, minimumDaysInFirstWeek: 1, gregorianStartDate: nil)
2467+
let dcCalendar_noTimeZone = Calendar(identifier: .japanese, locale: Locale(identifier: ""), timeZone: .gmt, firstWeekday: 1, minimumDaysInFirstWeek: 1, gregorianStartDate: nil)
24682468
var dc_customCalendarNoTimeZone_customTimeZone = dc
24692469
dc_customCalendarNoTimeZone_customTimeZone.calendar = dcCalendar_noTimeZone
24702470
dc_customCalendarNoTimeZone_customTimeZone.timeZone = .init(secondsFromGMT: 28800)

0 commit comments

Comments
 (0)