File tree Expand file tree Collapse file tree 2 files changed +12
-3
lines changed
Expand file tree Collapse file tree 2 files changed +12
-3
lines changed Original file line number Diff line number Diff line change @@ -93,7 +93,7 @@ public func waitUntil(
9393 file: FileString = #filePath,
9494 line: UInt = #line,
9595 column: UInt = #column,
96- action: @escaping ( @escaping ( ) -> Void ) async -> Void
96+ action: @escaping ( @escaping @ Sendable ( ) -> Void ) async -> Void
9797) async {
9898 await throwableUntil (
9999 timeout: timeout,
@@ -116,7 +116,7 @@ public func waitUntil(
116116 file: FileString = #filePath,
117117 line: UInt = #line,
118118 column: UInt = #column,
119- action: @escaping ( @escaping ( ) -> Void ) -> Void
119+ action: @escaping ( @escaping @ Sendable ( ) -> Void ) -> Void
120120) async {
121121 await throwableUntil (
122122 timeout: timeout,
@@ -134,7 +134,7 @@ private enum ErrorResult {
134134private func throwableUntil(
135135 timeout: NimbleTimeInterval ,
136136 sourceLocation: SourceLocation ,
137- action: @escaping ( @escaping ( ) -> Void ) async throws -> Void ) async {
137+ action: @escaping ( @escaping @ Sendable ( ) -> Void ) async throws -> Void ) async {
138138 let leeway = timeout. divided
139139 let result = await performBlock (
140140 timeoutInterval: timeout,
Original file line number Diff line number Diff line change @@ -189,6 +189,15 @@ final class AsyncAwaitTest: XCTestCase { // swiftlint:disable:this type_body_len
189189 }
190190 }
191191
192+ func testWaitUntilUsingSendable( ) async {
193+ await waitUntil { done in
194+ let queue = OperationQueue ( )
195+ let op = BlockOperation { }
196+ op. completionBlock = done
197+ queue. addOperation ( op)
198+ }
199+ }
200+
192201 func testWaitUntilTimesOutIfNotCalled( ) async {
193202 await failsWithErrorMessage ( " Waited more than 1.0 second " ) {
194203 await waitUntil ( timeout: . seconds( 1 ) ) { _ in return }
You can’t perform that action at this time.
0 commit comments