File tree 2 files changed +13
-4
lines changed
Tests/OpenAPIURLSessionTests
2 files changed +13
-4
lines changed Original file line number Diff line number Diff line change 15
15
import Foundation
16
16
import PackageDescription
17
17
18
+ // General Swift-settings for all targets.
19
+ let swiftSettings : [ SwiftSetting ] = [
20
+ // https://github.com/apple/swift-evolution/blob/main/proposals/0335-existential-any.md
21
+ // Require `any` for existential types.
22
+ . enableUpcomingFeature( " ExistentialAny " )
23
+ ]
24
+
18
25
let package = Package (
19
26
name: " swift-openapi-urlsession " ,
20
27
platforms: [
@@ -35,11 +42,13 @@ let package = Package(
35
42
name: " OpenAPIURLSession " ,
36
43
dependencies: [
37
44
. product( name: " OpenAPIRuntime " , package : " swift-openapi-runtime " ) ,
38
- ]
45
+ ] ,
46
+ swiftSettings: swiftSettings
39
47
) ,
40
48
. testTarget(
41
49
name: " OpenAPIURLSessionTests " ,
42
- dependencies: [ " OpenAPIURLSession " ]
50
+ dependencies: [ " OpenAPIURLSession " ] ,
51
+ swiftSettings: swiftSettings
43
52
) ,
44
53
]
45
54
)
Original file line number Diff line number Diff line change @@ -59,7 +59,7 @@ class URLSessionTransportTests: XCTestCase {
59
59
body: Data ( " 👋 " . utf8)
60
60
)
61
61
)
62
- let transport : ClientTransport = URLSessionTransport (
62
+ let transport : any ClientTransport = URLSessionTransport (
63
63
configuration: . init( session: MockURLProtocol . mockURLSession)
64
64
)
65
65
let request = OpenAPIRuntime . Request (
@@ -81,7 +81,7 @@ class URLSessionTransportTests: XCTestCase {
81
81
}
82
82
83
83
class MockURLProtocol : URLProtocol {
84
- static var mockHTTPResponses : [ URL : Result < ( response: HTTPURLResponse , body: Data ? ) , Error > ] = [ : ]
84
+ static var mockHTTPResponses : [ URL : Result < ( response: HTTPURLResponse , body: Data ? ) , any Error > ] = [ : ]
85
85
86
86
static var recordedHTTPRequests : [ URLRequest ] = [ ]
87
87
You can’t perform that action at this time.
0 commit comments