Skip to content

Commit 796d1b7

Browse files
committed
Suppress xcode 12 warnings in the tests
1 parent 842272d commit 796d1b7

File tree

5 files changed

+13
-13
lines changed

5 files changed

+13
-13
lines changed

Tests/AlgoliaSearchClientTests/Helper/XCTest+Codable.swift

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ func AssertDecode<T: Codable & Equatable>(_ input: JSON, expected: T, file: Stat
2424
jsonDecoder.dateDecodingStrategy = .swiftAPIClient
2525
let decoded = try jsonDecoder.decode(T.self, from: data)
2626

27-
XCTAssertEqual(expected, decoded, file: file, line: line)
27+
XCTAssertEqual(expected, decoded, file: (file), line: line)
2828
}
2929

3030
func AssertDecode<T: Codable>(_ input: JSON, expected: T, file: StaticString = #file, line: UInt = #line) throws {
@@ -40,7 +40,7 @@ func AssertDecode<T: Codable>(_ input: JSON, expected: T, file: StaticString = #
4040
let decodedJSON = try JSON(decoded)
4141
let expectedJSON = try JSON(expected)
4242

43-
XCTAssertEqual(expectedJSON, decodedJSON, file: file, line: line)
43+
XCTAssertEqual(expectedJSON, decodedJSON, file: (file), line: line)
4444
}
4545

4646
@discardableResult func AssertDecode<T: Decodable>(jsonFilename filename: String, expected: T.Type, file: StaticString = #file, line: UInt = #line) throws -> T {
@@ -58,14 +58,14 @@ func AssertEncode<T: Encodable>(_ value: T, expected: JSON, file: StaticString =
5858
jsonDecoder.dateDecodingStrategy = .swiftAPIClient
5959
let jsonFromValue = try jsonDecoder.decode(JSON.self, from: valueData)
6060

61-
XCTAssertEqual(jsonFromValue, expected, file: file, line: line)
61+
XCTAssertEqual(jsonFromValue, expected, file: (file), line: line)
6262
}
6363

6464
func AssertEquallyEncoded<A: Encodable, B: Encodable>(_ l: A, _ r: B, file: StaticString = #file, line: UInt = #line) throws {
6565
let encoder = JSONEncoder()
6666
encoder.dateEncodingStrategy = .swiftAPIClient
6767
let lData = try encoder.encode(l)
6868
let rData = try encoder.encode(r)
69-
XCTAssertEqual(lData, rData, file: file, line: line)
69+
XCTAssertEqual(lData, rData, file: (file), line: line)
7070
}
7171

Tests/AlgoliaSearchClientTests/Helper/XCTest+HTTPError.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ import XCTest
1212
func AssertThrowsHTTPError<T>(_ body: @autoclosure () throws -> T, statusCode: Int, file: StaticString = #file, line: UInt = #line) throws {
1313
do {
1414
let _ = try body()
15-
XCTFail("Expected HTTP error", file: file, line: line)
15+
XCTFail("Expected HTTP error", file: (file), line: line)
1616
} catch let error {
1717
guard let httpError = error as? HTTPError, httpError.statusCode == statusCode else {
1818
throw error

Tests/AlgoliaSearchClientTests/Helper/XCTest+Wait.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ func AssertWait<W: AnyWaitable>(_ waitable: W, timeout: TimeInterval = defaultWa
1616
try waitable.wait(timeout: 20, requestOptions: nil)
1717
} catch let error {
1818
let isTimeoutError = error as? WaitTask.Error == WaitTask.Error.timeout
19-
try XCTSkipIf(isTimeoutError, file: file, line: line)
19+
try XCTSkipIf(isTimeoutError, file: (file), line: line)
2020
throw error
2121
}
2222
}

Tests/AlgoliaSearchClientTests/Integration/QueryRulesIntegrationTests.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ class QueryRulesIntegrationTests: OnlineTestCase {
7272

7373
try index.saveRules(rules).wait()
7474

75-
let response = try index.searchRules(RuleQuery().set(\.context, to: "summer"))
75+
//let response = try index.searchRules(RuleQuery().set(\.context, to: "summer"))
7676
//TODO: understand why search for rules doesn't work after multi-condition introduction
7777
//XCTAssertEqual(response.nbHits, 1)
7878

Tests/AlgoliaSearchClientTests/Unit/Command/AlgoliaCommandTest.swift

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -24,13 +24,13 @@ extension AlgoliaCommandTest {
2424

2525
func check(command: AlgoliaCommand, callType: CallType, method: HTTPMethod, urlPath: String, queryItems: Set<URLQueryItem>, body: Data?, additionalHeaders: [HTTPHeaderKey: String]? = nil, requestOptions: RequestOptions, file: StaticString = #file, line: UInt = #line) {
2626
let request = command.urlRequest
27-
XCTAssertEqual(command.callType, callType, file: file, line: line)
28-
XCTAssertEqual(request.httpMethod, method.rawValue, file: file, line: line)
29-
XCTAssertEqual(request.allHTTPHeaderFields, requestOptions.headers.merging(additionalHeaders ?? [:]).mapKeys { $0.rawValue }, file: file, line: line)
27+
XCTAssertEqual(command.callType, callType, file: (file), line: line)
28+
XCTAssertEqual(request.httpMethod, method.rawValue, file: (file), line: line)
29+
XCTAssertEqual(request.allHTTPHeaderFields, requestOptions.headers.merging(additionalHeaders ?? [:]).mapKeys { $0.rawValue }, file: (file), line: line)
3030
let comps = URLComponents(url: request.url!, resolvingAgainstBaseURL: false)!
31-
XCTAssertEqual(request.url?.path, urlPath, file: file, line: line)
32-
XCTAssertEqual(comps.queryItems.flatMap(Set.init), queryItems, file: file, line: line)
33-
XCTAssertEqual(request.httpBody, body, file: file, line: line)
31+
XCTAssertEqual(request.url?.path, urlPath, file: (file), line: line)
32+
XCTAssertEqual(comps.queryItems.flatMap(Set.init), queryItems, file: (file), line: line)
33+
XCTAssertEqual(request.httpBody, body, file: (file), line: line)
3434
}
3535

3636
}

0 commit comments

Comments
 (0)