@@ -244,18 +244,20 @@ class TestCalendar: XCTestCase {
244
244
calendar. locale = Locale ( identifier: " en_US_POSIX " )
245
245
calendar. timeZone = try XCTUnwrap ( TimeZone ( secondsFromGMT: 0 ) )
246
246
247
+ let expectedDescription = calendar. timeZone == TimeZone . current ? " GMT (current) " : " GMT (fixed) "
248
+
247
249
let calendarCopy = calendar
248
250
XCTAssertEqual ( calendarCopy. timeZone. identifier, " GMT " )
249
- XCTAssertEqual ( calendarCopy. timeZone. description, " GMT (fixed) " )
251
+ XCTAssertEqual ( calendarCopy. timeZone. description, expectedDescription )
250
252
251
253
let dc = try calendarCopy. dateComponents ( in: XCTUnwrap ( TimeZone ( identifier: " America/New_York " ) ) , from: XCTUnwrap ( df. date ( from: " 2019-01-01 " ) ) )
252
254
XCTAssertEqual ( calendarCopy. timeZone. identifier, " GMT " )
253
- XCTAssertEqual ( calendarCopy. timeZone. description, " GMT (fixed) " )
255
+ XCTAssertEqual ( calendarCopy. timeZone. description, expectedDescription )
254
256
255
257
let dt = try XCTUnwrap ( calendarCopy. date ( from: dc) )
256
258
XCTAssertEqual ( dt. description, " 2019-01-01 00:00:00 +0000 " )
257
259
XCTAssertEqual ( calendarCopy. timeZone. identifier, " GMT " )
258
- XCTAssertEqual ( calendarCopy. timeZone. description, " GMT (fixed) " )
260
+ XCTAssertEqual ( calendarCopy. timeZone. description, expectedDescription )
259
261
XCTAssertEqual ( calendarCopy. timeZone, calendar. timeZone)
260
262
XCTAssertEqual ( calendarCopy, calendar)
261
263
}
0 commit comments