|
|
@ -18,11 +18,11 @@ final class TimeAgoTests: XCTestCase { |
|
|
|
XCTAssertEqual(time_ago_since(Date.now.addingTimeInterval(-2), calendar), "now") |
|
|
|
XCTAssertEqual(time_ago_since(Date.now.addingTimeInterval(-3), calendar), "3s") |
|
|
|
XCTAssertEqual(time_ago_since(Date.now.addingTimeInterval(-59), calendar), "59s") |
|
|
|
XCTAssertEqual(time_ago_since(Date.now.addingTimeInterval(-60), calendar), "1min") |
|
|
|
XCTAssertEqual(time_ago_since(Date.now.addingTimeInterval(-3599), calendar), "59min") |
|
|
|
XCTAssertEqual(time_ago_since(Date.now.addingTimeInterval(-3600), calendar), "1h") |
|
|
|
XCTAssertEqual(time_ago_since(Date.now.addingTimeInterval(-86399), calendar), "23h") |
|
|
|
XCTAssertEqual(time_ago_since(Date.now.addingTimeInterval(-86400), calendar), "1d") |
|
|
|
XCTAssertEqual(time_ago_since(Date.now.addingTimeInterval(-60), calendar), "1m") |
|
|
|
XCTAssertEqual(time_ago_since(calendar.date(byAdding: .hour, value: -1, to: Date.now)!.addingTimeInterval(1), calendar), "59m") |
|
|
|
XCTAssertEqual(time_ago_since(calendar.date(byAdding: .hour, value: -1, to: Date.now)!, calendar), "1h") |
|
|
|
XCTAssertEqual(time_ago_since(calendar.date(byAdding: .day, value: -1, to: Date.now)!.addingTimeInterval(1), calendar), "23h") |
|
|
|
XCTAssertEqual(time_ago_since(calendar.date(byAdding: .day, value: -1, to: Date.now)!, calendar), "1d") |
|
|
|
XCTAssertEqual(time_ago_since(calendar.date(byAdding: .weekOfMonth, value: -1, to: Date.now)!.addingTimeInterval(1), calendar), "6d") |
|
|
|
XCTAssertEqual(time_ago_since(calendar.date(byAdding: .weekOfMonth, value: -1, to: Date.now)!, calendar), "1w") |
|
|
|
XCTAssertEqual(time_ago_since(calendar.date(byAdding: .weekOfMonth, value: -2, to: Date.now)!, calendar), "2w") |
|
|
|