@@ -60,7 +60,7 @@ public struct ExitTest: Sendable, ~Copyable {
60
60
/// Do not invoke this closure directly. Instead, invoke ``callAsFunction()``
61
61
/// to run the exit test. Running the exit test will always terminate the
62
62
/// 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 }
64
64
65
65
/// Storage for ``observedValues``.
66
66
///
@@ -251,7 +251,7 @@ extension ExitTest {
251
251
}
252
252
253
253
do {
254
- try await body ( self )
254
+ try await body ( & self )
255
255
} catch {
256
256
_errorInMain ( error)
257
257
}
@@ -307,7 +307,7 @@ extension ExitTest: DiscoverableAsTestContent {
307
307
308
308
// Wrap the body function in a thunk that decodes any captured state and
309
309
// 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
311
311
let values : ( repeat each T ) = try exitTest. capturedValues. takeCapturedValues ( )
312
312
try await body ( repeat each values)
313
313
}
@@ -492,7 +492,7 @@ extension ExitTest {
492
492
/// are available or the child environment is otherwise terminated. The parent
493
493
/// environment is then responsible for interpreting those results and
494
494
/// 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
496
496
497
497
/// Make a file handle from the string contained in the given environment
498
498
/// variable.
@@ -615,14 +615,10 @@ extension ExitTest {
615
615
}
616
616
}
617
617
618
- // TODO: get correct source location
619
- Issue . withErrorRecording ( at: . __here( ) , configuration: configuration) {
620
- try result. _decodeCapturedValuesForEntryPoint ( )
621
- }
622
-
623
618
result. body = { [ configuration, body = result. body] exitTest in
624
619
try await Configuration . withCurrent ( configuration) {
625
- try await body ( exitTest)
620
+ try exitTest. _decodeCapturedValuesForEntryPoint ( )
621
+ try await body ( & exitTest)
626
622
}
627
623
}
628
624
return result
0 commit comments