Skip to content

Commit

Permalink
Updated GET/POST stress test
Browse files Browse the repository at this point in the history
  • Loading branch information
1ec5 committed Mar 10, 2020
1 parent c70125a commit 78fb76b
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions Tests/MapboxDirectionsTests/DirectionsTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ class DirectionsTests: XCTestCase {
XCTAssertEqual(directions.apiEndpoint.absoluteString, "https://api.mapbox.com")
}

let maximumCoordinateCount = 795
let maximumCoordinateCount = 794

func testGETRequest() {
// Bumps right up against MaximumURLLength
Expand All @@ -54,7 +54,7 @@ class DirectionsTests: XCTestCase {
XCTAssertLessThanOrEqual(url.absoluteString.count, MaximumURLLength, "maximumCoordinateCount is too high")

let components = URLComponents(string: url.absoluteString)
XCTAssertEqual(components?.queryItems?.count, 7)
XCTAssertEqual(components?.queryItems?.count, 8)
XCTAssertTrue(components?.path.contains(coordinates.compactMap { $0.requestDescription }.joined(separator: ";")) ?? false)

let request = directions.urlRequest(forCalculating: options)
Expand All @@ -74,7 +74,7 @@ class DirectionsTests: XCTestCase {
XCTAssertNotNil(request.httpBody)
var components = URLComponents()
components.query = String(data: request.httpBody ?? Data(), encoding: .utf8)
XCTAssertEqual(components.queryItems?.count, 7)
XCTAssertEqual(components.queryItems?.count, 8)
XCTAssertEqual(components.queryItems?.first { $0.name == "coordinates" }?.value,
coordinates.compactMap { $0.requestDescription }.joined(separator: ";"))
}
Expand Down

0 comments on commit 78fb76b

Please sign in to comment.