Fix tests (#356)

This commit is contained in:
David Evans
2021-04-27 15:43:07 +01:00
committed by GitHub
parent e4fded76ac
commit f3521033ef
2 changed files with 9 additions and 3 deletions
+1 -1
View File
@@ -22,7 +22,7 @@ let package = Package(
],
dependencies: [
.package(url: "https://github.com/apple/swift-nio.git", from: "2.27.0"),
.package(url: "https://github.com/apple/swift-nio-ssl.git", from: "2.8.0"),
.package(url: "https://github.com/apple/swift-nio-ssl.git", from: "2.12.0"),
.package(url: "https://github.com/apple/swift-nio-extras.git", from: "1.3.0"),
.package(url: "https://github.com/apple/swift-nio-transport-services.git", from: "1.5.1"),
.package(url: "https://github.com/apple/swift-log.git", from: "1.4.0"),
@@ -2711,7 +2711,10 @@ class HTTPClientTests: XCTestCase {
if isTestingNIOTS() {
XCTAssertEqual(error as? ChannelError, .connectTimeout(.milliseconds(100)))
} else {
XCTAssertEqual(error as? NIOSSLError, NIOSSLError.uncleanShutdown)
switch error as? NIOSSLError {
case .some(.handshakeFailed(.sslError(_))): break
default: XCTFail("Handshake failed with unexpected error: \(String(describing: error))")
}
}
}
}
@@ -2755,7 +2758,10 @@ class HTTPClientTests: XCTestCase {
if isTestingNIOTS() {
XCTAssertEqual(error as? ChannelError, .connectTimeout(.milliseconds(200)))
} else {
XCTAssertEqual(error as? NIOSSLError, NIOSSLError.uncleanShutdown)
switch error as? NIOSSLError {
case .some(.handshakeFailed(.sslError(_))): break
default: XCTFail("Handshake failed with unexpected error: \(String(describing: error))")
}
}
}
}