Repository: Alamofire/Alamofire
File: Tests/UploadTests.swift (Swift)

Code before:
        var data: Data?
        var error: Error?
        var streamingFromDisk: Bool?

        // When
        manager.upload(multipartFormData: { multipartFormData in
            multipartFormData.append(french, withName: "french")
            multipartFormData.append(japanese, withName: "japanese")
        }, to: urlString,
           encodingCompletion: { result in
            switch result {
            case let .success(upload, uploadStreamingFromDisk, _):
                streamingFromDisk = uploadStreamingFromDisk

                upload.response { defaultResponse in
                    request = defaultResponse.request
                    response = defaultResponse.response
                    data = defaultResponse.data
                    error = defaultResponse.error

                    expectation.fulfill()
                }
            case .failure:
                expectation.fulfill()
            }
        })

        waitForExpectations(timeout: timeout, handler: nil)

        // Then
        XCTAssertNotNil(request, "request should not be nil")
        XCTAssertNotNil(response, "response should not be nil")
        XCTAssertNotNil(data, "data should not be nil")
        XCTAssertNil(error, "error should be nil")

        if let streamingFromDisk = streamingFromDisk {
            XCTAssertTrue(streamingFromDisk, "streaming from disk should be true")
        } else {
            XCTFail("streaming from disk should not be nil")
        }
    }
    #endif

    // MARK: Combined Test Execution

    private func executeMultipartFormDataUploadRequestWithProgress(streamFromDisk: Bool) {
        // Given
        let urlString = "https://httpbin.org/post"
        let loremData1: Data = {
            var loremValues: [String] = []
            for _ in 1...1_500 {

Review comment (bug):
How about?

```swift
// When
manager.upload(
    multipartFormData: { multipartFormData in
        multipartFormData.append(french, withName: "french")
        multipartFormData.append(japanese, withName: "japanese")
    }, 
    to: urlString,
    encodingCompletion: { result in
        switch result {
        case let .success(upload, uploadStreamingFromDisk, _):
            streamingFromDisk = uploadStreamingFromDisk

            upload.response { defaultResponse in
                request = defaultResponse.request
                response = defaultResponse.response
                data = defaultResponse.data
                error = defaultResponse.error

                expectation.fulfill()
            }
        case .failure:
            expectation.fulfill()
        }
    }
)
```

Code after:
        var data: Data?
        var error: Error?
        var streamingFromDisk: Bool?

        // When
        manager.upload(
            multipartFormData: { multipartFormData in
                multipartFormData.append(french, withName: "french")
                multipartFormData.append(japanese, withName: "japanese")
            },
            to: urlString,
            encodingCompletion: { result in
                switch result {
                case let .success(upload, uploadStreamingFromDisk, _):
                    streamingFromDisk = uploadStreamingFromDisk

                    upload.response { defaultResponse in
                        request = defaultResponse.request
                        response = defaultResponse.response
                        data = defaultResponse.data
                        error = defaultResponse.error

                        expectation.fulfill()
                    }
                case .failure:
                    expectation.fulfill()
                }
            }
        )

        waitForExpectations(timeout: timeout, handler: nil)

        // Then
        XCTAssertNotNil(request, "request should not be nil")
        XCTAssertNotNil(response, "response should not be nil")
        XCTAssertNotNil(data, "data should not be nil")
        XCTAssertNil(error, "error should be nil")

        if let streamingFromDisk = streamingFromDisk {
            XCTAssertTrue(streamingFromDisk, "streaming from disk should be true")
        } else {
            XCTFail("streaming from disk should not be nil")
        }
    }
#endif

    // MARK: Combined Test Execution

    private func executeMultipartFormDataUploadRequestWithProgress(streamFromDisk: Bool) {
        // Given
        let urlString = "https://httpbin.org/post"