Skip to content

Commit 3275b30

Browse files
Jason JiJason Ji
authored andcommitted
Update tests to work beyond today
1 parent 2569d56 commit 3275b30

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

TestFoundation/TestNSCalendar.swift

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -93,14 +93,14 @@ class TestNSCalendar: XCTestCase {
9393

9494
func test_addingDates() {
9595
let calendar = Calendar.current
96-
let today = Date()
96+
let thisDay = calendar.date(from: DateComponents(year: 2016, month: 10, day: 4))!
9797
let diffComponents = DateComponents(day: 1)
98-
let tomorrow = calendar.date(byAdding: diffComponents, to: today)
98+
let dayAfter = calendar.date(byAdding: diffComponents, to: thisDay)
9999

100-
let tomorrowComponents = calendar.dateComponents([.year, .month, .day], from: tomorrow!)
101-
XCTAssertEqual(tomorrowComponents.year, 2016)
102-
XCTAssertEqual(tomorrowComponents.month, 10)
103-
XCTAssertEqual(tomorrowComponents.day, 5)
100+
let dayAfterComponents = calendar.dateComponents([.year, .month, .day], from: dayAfter!)
101+
XCTAssertEqual(dayAfterComponents.year, 2016)
102+
XCTAssertEqual(dayAfterComponents.month, 10)
103+
XCTAssertEqual(dayAfterComponents.day, 5)
104104
}
105105
}
106106

0 commit comments

Comments
 (0)