Skip to content

Commit a83a49f

Browse files
Add missing availability guards in tests
1 parent c70e085 commit a83a49f

File tree

4 files changed

+9
-1
lines changed

4 files changed

+9
-1
lines changed

Sources/AsyncHTTPClient/NIOTransportServices/TLSConfiguration.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ extension TLSVersion {
5757
}
5858
}
5959

60-
@available(macOS 10.14, iOS 12.0, tvOS 12.0, watchOS 6.0, *)
60+
@available(macOS 10.14, iOS 12.0, tvOS 12.0, watchOS 5.0, *)
6161
extension TLSConfiguration {
6262
/// Dispatch queue used by Network framework TLS to control certificate verification
6363
static var tlsDispatchQueue = DispatchQueue(label: "TLSDispatch")

Tests/AsyncHTTPClientTests/HTTPClientRequestTests.swift

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -467,6 +467,7 @@ class HTTPClientRequestTests: XCTestCase {
467467
}
468468
}
469469

470+
@available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *)
470471
func testChunkingRandomAccessCollection() async throws {
471472
let body = try await HTTPClientRequest.Body.bytes(
472473
Array(repeating: 0, count: bagOfBytesToByteBufferConversionChunkSize) +
@@ -483,6 +484,7 @@ class HTTPClientRequestTests: XCTestCase {
483484
XCTAssertEqual(body, expectedChunks)
484485
}
485486

487+
@available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *)
486488
func testChunkingCollection() async throws {
487489
let body = try await HTTPClientRequest.Body.bytes(
488490
(
@@ -502,6 +504,7 @@ class HTTPClientRequestTests: XCTestCase {
502504
XCTAssertEqual(body, expectedChunks)
503505
}
504506

507+
@available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *)
505508
func testChunkingSequenceThatDoesNotImplementWithContiguousStorageIfAvailable() async throws {
506509
let bagOfBytesToByteBufferConversionChunkSize = 8
507510
let body = try await HTTPClientRequest.Body._bytes(
@@ -522,6 +525,7 @@ class HTTPClientRequestTests: XCTestCase {
522525
XCTAssertEqual(body, expectedChunks)
523526
}
524527

528+
@available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *)
525529
func testChunkingSequenceFastPath() async throws {
526530
func makeBytes() -> some Sequence<UInt8> & Sendable {
527531
Array(repeating: 0, count: bagOfBytesToByteBufferConversionChunkSize) +
@@ -543,6 +547,7 @@ class HTTPClientRequestTests: XCTestCase {
543547
XCTAssertEqual(body, expectedChunks)
544548
}
545549

550+
@available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *)
546551
func testChunkingSequenceFastPathExceedingByteBufferMaxSize() async throws {
547552
let bagOfBytesToByteBufferConversionChunkSize = 8
548553
let byteBufferMaxSize = 16
@@ -602,6 +607,7 @@ class HTTPClientRequestTests: XCTestCase {
602607
}
603608
}
604609

610+
@available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *)
605611
extension AsyncSequence {
606612
func collect() async throws -> [Element] {
607613
try await self.reduce(into: []) { $0 += CollectionOfOne($1) }

Tests/AsyncHTTPClientTests/HTTPClientResponseTests.swift

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ import Logging
1717
import NIOCore
1818
import XCTest
1919

20+
@available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *)
2021
final class HTTPClientResponseTests: XCTestCase {
2122
func testSimpleResponse() {
2223
let response = HTTPClientResponse.expectedContentLength(requestMethod: .GET, headers: ["content-length": "1025"], status: .ok)

Tests/AsyncHTTPClientTests/HTTPClientTests.swift

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3526,6 +3526,7 @@ final class HTTPClientTests: XCTestCaseHTTPClientTestsBaseClass {
35263526
XCTAssertEqual(.ok, response.status)
35273527
}
35283528

3529+
@available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *)
35293530
func testAsyncExecuteWithCustomTLS() async throws {
35303531
let httpsBin = HTTPBin(.http1_1(ssl: true))
35313532
defer {

0 commit comments

Comments
 (0)