You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This is not a lot of precision loss, but in principle, this library should be able to round-trip the same number that it got from the Directions API. Otherwise, there could be some inconsistency with other libraries like MapboxNavigationNative and MapboxMaps.
This behavior was introduced in 9cffdd3 for #382, apparently to make an integration test pass. Most likely, the test had been failing because of an overly strict XCTAssertEquals(_:_:_:) call, which should’ve been replaced by either XCTAssertEqualsWithAccuracy(_:_:accuracy:_:) or JSONSerialization.assertObjectsAreEqual(_:_:approximate:). The latter method was implemented in 4292391, later in the same PR.
/cc @mapbox/navigation-ios
The text was updated successfully, but these errors were encountered:
@Udumft noticed that RouteStep rounds distances to increments of 0.1 meters and times to increments of 0.1 seconds when encoding to JSON:
mapbox-directions-swift/Sources/MapboxDirections/RouteStep.swift
Lines 493 to 495 in f40fcea
This is not a lot of precision loss, but in principle, this library should be able to round-trip the same number that it got from the Directions API. Otherwise, there could be some inconsistency with other libraries like MapboxNavigationNative and MapboxMaps.
This behavior was introduced in 9cffdd3 for #382, apparently to make an integration test pass. Most likely, the test had been failing because of an overly strict
XCTAssertEquals(_:_:_:)
call, which should’ve been replaced by eitherXCTAssertEqualsWithAccuracy(_:_:accuracy:_:)
orJSONSerialization.assertObjectsAreEqual(_:_:approximate:)
. The latter method was implemented in 4292391, later in the same PR./cc @mapbox/navigation-ios
The text was updated successfully, but these errors were encountered: