@@ -60,7 +60,7 @@ public struct ExitTest: Sendable, ~Copyable {
6060 /// Do not invoke this closure directly. Instead, invoke ``callAsFunction()``
6161 /// to run the exit test. Running the exit test will always terminate the
6262 /// current process.
63- fileprivate var body : @Sendable ( _ exitTest: borrowing Self ) async throws -> Void = { _ in }
63+ fileprivate var body : @Sendable ( _ exitTest: inout Self ) async throws -> Void = { _ in }
6464
6565 /// Storage for ``observedValues``.
6666 ///
@@ -251,7 +251,7 @@ extension ExitTest {
251251 }
252252
253253 do {
254- try await body ( self )
254+ try await body ( & self )
255255 } catch {
256256 _errorInMain ( error)
257257 }
@@ -307,7 +307,7 @@ extension ExitTest: DiscoverableAsTestContent {
307307
308308 // Wrap the body function in a thunk that decodes any captured state and
309309 // passes it along.
310- let body : @Sendable ( borrowing ExitTest ) async throws -> Void = { exitTest in
310+ let body : @Sendable ( inout Self ) async throws -> Void = { exitTest in
311311 let values : ( repeat each T ) = try exitTest. capturedValues. takeCapturedValues ( )
312312 try await body ( repeat each values)
313313 }
@@ -492,7 +492,7 @@ extension ExitTest {
492492 /// are available or the child environment is otherwise terminated. The parent
493493 /// environment is then responsible for interpreting those results and
494494 /// recording any issues that occur.
495- public typealias Handler = @Sendable ( _ exitTest: borrowing ExitTest ) async throws -> ExitTest . Result
495+ public typealias Handler = @Sendable ( _ exitTest: borrowing Self ) async throws -> ExitTest . Result
496496
497497 /// Make a file handle from the string contained in the given environment
498498 /// variable.
@@ -615,14 +615,10 @@ extension ExitTest {
615615 }
616616 }
617617
618- // TODO: get correct source location
619- Issue . withErrorRecording ( at: . __here( ) , configuration: configuration) {
620- try result. _decodeCapturedValuesForEntryPoint ( )
621- }
622-
623618 result. body = { [ configuration, body = result. body] exitTest in
624619 try await Configuration . withCurrent ( configuration) {
625- try await body ( exitTest)
620+ try exitTest. _decodeCapturedValuesForEntryPoint ( )
621+ try await body ( & exitTest)
626622 }
627623 }
628624 return result
0 commit comments