Skip to content

Commit 918db8f

Browse files
committed
Run generate_linux_tests.rb and SwiftFormat
1 parent 0b95c8a commit 918db8f

File tree

1 file changed

+8
-6
lines changed

1 file changed

+8
-6
lines changed

Tests/AsyncHTTPClientTests/RequestBagTests.swift

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -454,7 +454,7 @@ final class RequestBagTests: XCTestCase {
454454
XCTAssertEqual($0 as? HTTPClientError, .cancelled)
455455
}
456456
}
457-
457+
458458
func testDidReceiveBodyPartFailedPromise() {
459459
let embeddedEventLoop = EmbeddedEventLoop()
460460
defer { XCTAssertNoThrow(try embeddedEventLoop.syncShutdownGracefully()) }
@@ -468,21 +468,24 @@ final class RequestBagTests: XCTestCase {
468468
body: .byteBuffer(.init(bytes: [1]))
469469
))
470470
guard let request = maybeRequest else { return XCTFail("Expected to have a request") }
471-
471+
472472
struct MyError: Error, Equatable {}
473473
final class Delegate: HTTPClientResponseDelegate {
474474
typealias Response = Void
475475
let didFinishPromise: EventLoopPromise<Void>
476476
init(didFinishPromise: EventLoopPromise<Void>) {
477477
self.didFinishPromise = didFinishPromise
478478
}
479+
479480
func didReceiveBodyPart(task: HTTPClient.Task<Void>, _ buffer: ByteBuffer) -> EventLoopFuture<Void> {
480481
task.eventLoop.makeFailedFuture(MyError())
481482
}
483+
482484
func didReceiveError(task: HTTPClient.Task<Void>, _ error: Error) {
483485
self.didFinishPromise.fail(error)
484486
}
485-
func didFinishRequest(task: AsyncHTTPClient.HTTPClient.Task<Void>) throws -> Void {
487+
488+
func didFinishRequest(task: AsyncHTTPClient.HTTPClient.Task<Void>) throws {
486489
XCTFail("\(#function) should not be called")
487490
self.didFinishPromise.succeed(())
488491
}
@@ -506,11 +509,10 @@ final class RequestBagTests: XCTestCase {
506509

507510
bag.resumeRequestBodyStream()
508511
XCTAssertNoThrow(try executor.receiveRequestBody { XCTAssertEqual($0, ByteBuffer(bytes: [1])) })
509-
512+
510513
bag.receiveResponseHead(.init(version: .http1_1, status: .ok))
511-
512-
bag.succeedRequest([ByteBuffer([1])])
513514

515+
bag.succeedRequest([ByteBuffer([1])])
514516

515517
XCTAssertThrowsError(try delegate.didFinishPromise.futureResult.wait()) { error in
516518
XCTAssertEqualTypeAndValue(error, MyError())

0 commit comments

Comments
 (0)