Skip to content

Commit

Permalink
vk/NAVIOS-1099: added unit test; accepted breaking changes
Browse files Browse the repository at this point in the history
  • Loading branch information
Udumft committed Jun 12, 2024
1 parent bac4246 commit 2c42eae
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 1 deletion.
14 changes: 14 additions & 0 deletions Tests/MapboxDirectionsTests/RouteResponseTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -98,4 +98,18 @@ class RouteResponseTests: XCTestCase {
XCTAssertEqual(unwrappedResponse.exclusionViolations(routeIndex: 0, legIndex: 0, stepIndex: 9, intersectionIndex: 0).first!.roadClasses, .ferry)
XCTAssertEqual(unwrappedResponse.exclusionViolations(routeIndex: 0, legIndex: 0, stepIndex: 24, intersectionIndex: 7).first!.roadClasses, .toll)
}

func testRefreshTTL() {
let options = RouteOptions(coordinates: [])
let refreshTTL: TimeInterval = 60
let response = RouteResponse(httpResponse: nil,
options: .route(options),
credentials: BogusCredentials,
refreshTTL: refreshTTL)

XCTAssertNotNil(response.refreshTTL)
XCTAssertNotNil(response.refreshInvalidationDate)

XCTAssertEqual(response.refreshInvalidationDate, response.created.addingTimeInterval(refreshTTL))
}
}
4 changes: 3 additions & 1 deletion swift-package-baseline/breakage-allowlist-path.txt
Original file line number Diff line number Diff line change
@@ -1 +1,3 @@

API breakage: enumelement DirectionsError.refreshExpired has been added as a new enum case
API breakage: constructor DirectionsError.init(code:message:response:underlyingError:) has been removed
API breakage: constructor RouteResponse.init(httpResponse:identifier:routes:waypoints:options:credentials:) has been removed

0 comments on commit 2c42eae

Please sign in to comment.