Skip to content

Commit

Permalink
Remove @escaping from test closure in Application.test(_:_:) (#555)
Browse files Browse the repository at this point in the history
  • Loading branch information
adam-fowler committed Sep 17, 2024
1 parent b231249 commit f7f9b9e
Show file tree
Hide file tree
Showing 5 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion Sources/HummingbirdTesting/Application+Test.swift
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ extension ApplicationProtocol {
/// - test: test function
public func test<Value>(
_ testingSetup: TestingSetup,
_ test: @escaping @Sendable (any TestClientProtocol) async throws -> Value
_ test: @Sendable (any TestClientProtocol) async throws -> Value
) async throws -> Value {
let app: any ApplicationTestFramework = switch testingSetup.value {
case .router: try await RouterTestFramework(app: self)
Expand Down
2 changes: 1 addition & 1 deletion Sources/HummingbirdTesting/ApplicationTester.swift
Original file line number Diff line number Diff line change
Expand Up @@ -93,5 +93,5 @@ protocol ApplicationTestFramework {
associatedtype Client: TestClientProtocol

/// Run test server
func run<Value>(_ test: @escaping @Sendable (any TestClientProtocol) async throws -> Value) async throws -> Value
func run<Value>(_ test: @Sendable (any TestClientProtocol) async throws -> Value) async throws -> Value
}
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ final class AsyncHTTPClientTestFramework<App: ApplicationProtocol>: ApplicationT
}

/// Start tests
func run<Value>(_ test: @escaping @Sendable (TestClientProtocol) async throws -> Value) async throws -> Value {
func run<Value>(_ test: @Sendable (TestClientProtocol) async throws -> Value) async throws -> Value {
try await withThrowingTaskGroup(of: Void.self) { group in
let serviceGroup = ServiceGroup(
configuration: .init(
Expand Down
2 changes: 1 addition & 1 deletion Sources/HummingbirdTesting/LiveTestFramework.swift
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ final class LiveTestFramework<App: ApplicationProtocol>: ApplicationTestFramewor
}

/// Start tests
func run<Value>(_ test: @escaping @Sendable (TestClientProtocol) async throws -> Value) async throws -> Value {
func run<Value>(_ test: @Sendable (TestClientProtocol) async throws -> Value) async throws -> Value {
try await withThrowingTaskGroup(of: Void.self) { group in
let serviceGroup = ServiceGroup(
configuration: .init(
Expand Down
2 changes: 1 addition & 1 deletion Sources/HummingbirdTesting/RouterTestFramework.swift
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ struct RouterTestFramework<Responder: HTTPResponder>: ApplicationTestFramework w
}

/// Run test
func run<Value>(_ test: @escaping @Sendable (TestClientProtocol) async throws -> Value) async throws -> Value {
func run<Value>(_ test: @Sendable (TestClientProtocol) async throws -> Value) async throws -> Value {
let client = Client(
responder: self.responder,
logger: self.logger,
Expand Down

0 comments on commit f7f9b9e

Please sign in to comment.