Skip to content

Commit 6eb1666

Browse files
committed
Updated unit tests
1 parent f09ac40 commit 6eb1666

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

Tests/HTTPTests/HTTPTests.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -145,7 +145,7 @@ final class HTTPTests: XCTestCase {
145145

146146
func testServerGetBlob() async throws {
147147
let port = UInt16.random(in: 8080 ..< 9000)
148-
let blob = Data(repeating: .random(in: .min ... .max), count: 1024 * 1024 * 2)
148+
let blob = Data(repeating: .random(in: .min ... .max), count: 1024 * .random(in: 1 ... 10))
149149
var server: HTTPServer? = try await HTTPServer(configuration: .init(port: port), response: { (address, request) in
150150
if request.uri == "/blob", request.method == .get {
151151
return request.body.isEmpty ? .init(code: .ok, body: blob) : .init(code: .badRequest)
@@ -168,7 +168,7 @@ final class HTTPTests: XCTestCase {
168168

169169
func testServerPostBlob() async throws {
170170
let port = UInt16.random(in: 8080 ..< 9000)
171-
let blob = Data(repeating: .random(in: .min ... .max), count: 1024 * .random(in: 100 ..< 512))
171+
let blob = Data(repeating: .random(in: .min ... .max), count: 1024 * .random(in: 1 ... 10))
172172
var server: HTTPServer? = try await HTTPServer(configuration: .init(port: port), response: { (address, request) in
173173
if request.uri == "/blob", request.method == .post {
174174
XCTAssertEqual(request.headers[.contentLength], blob.count.description)

0 commit comments

Comments
 (0)