Skip to content

Commit a7c4977

Browse files
committed
swiftformat and linux tests
1 parent be4f9aa commit a7c4977

File tree

3 files changed

+9
-7
lines changed

3 files changed

+9
-7
lines changed

Sources/AsyncHTTPClient/HTTPHandler.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -651,7 +651,7 @@ internal class TaskHandler<Delegate: HTTPClientResponseDelegate>: RemovableChann
651651
let logger: Logger // We are okay to store the logger here because a TaskHandler is just for one request.
652652

653653
var state: State = .idle
654-
var expectedBodyLength: Int? = nil
654+
var expectedBodyLength: Int?
655655
var actualBodyLength: Int = 0
656656
var pendingRead = false
657657
var mayRead = true

Tests/AsyncHTTPClientTests/HTTPClientTests+XCTest.swift

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -110,6 +110,8 @@ extension HTTPClientTests {
110110
("testAllMethodsLog", testAllMethodsLog),
111111
("testClosingIdleConnectionsInPoolLogsInTheBackground", testClosingIdleConnectionsInPoolLogsInTheBackground),
112112
("testDelegateCallinsTolerateRandomEL", testDelegateCallinsTolerateRandomEL),
113+
("testContentLengthTooLongFails", testContentLengthTooLongFails),
114+
("testContentLengthTooShortFails", testContentLengthTooShortFails),
113115
]
114116
}
115117
}

Tests/AsyncHTTPClientTests/HTTPClientTests.swift

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2056,9 +2056,9 @@ class HTTPClientTests: XCTestCase {
20562056
let url = self.defaultHTTPBinURLPrefix + "/post"
20572057
XCTAssertThrowsError(
20582058
try self.defaultClient.execute(request:
2059-
Request(url: url,
2060-
body: .stream(length: 10) { streamWriter in
2061-
streamWriter.write(.byteBuffer(ByteBuffer(string: "1")))
2059+
Request(url: url,
2060+
body: .stream(length: 10) { streamWriter in
2061+
streamWriter.write(.byteBuffer(ByteBuffer(string: "1")))
20622062
})).wait()) { error in
20632063
XCTAssertEqual(error as! HTTPClientError, HTTPClientError.bodyLengthMismatch)
20642064
}
@@ -2072,9 +2072,9 @@ class HTTPClientTests: XCTestCase {
20722072
let tooLong = "XBAD BAD BAD NOT HTTP/1.1\r\n\r\n"
20732073
XCTAssertThrowsError(
20742074
try self.defaultClient.execute(request:
2075-
Request(url: url,
2076-
body: .stream(length: 1) { streamWriter in
2077-
streamWriter.write(.byteBuffer(ByteBuffer(string: tooLong)))
2075+
Request(url: url,
2076+
body: .stream(length: 1) { streamWriter in
2077+
streamWriter.write(.byteBuffer(ByteBuffer(string: tooLong)))
20782078
})).wait()) { error in
20792079
XCTAssertEqual(error as! HTTPClientError, HTTPClientError.bodyLengthMismatch)
20802080
}

0 commit comments

Comments
 (0)