@@ -16,41 +16,21 @@ func _recordIssue(
1616 else {
1717 #if DEBUG
1818 guard
19- let fromSyntaxNode = unsafeBitCast (
20- symbol: " $s7Testing12__ExpressionV16__fromSyntaxNodeyACSSFZ " ,
21- in: " Testing " ,
22- to: ( @convention( thin) ( String) - > __Expression) . self
23- ) ,
24- let checkValue = unsafeBitCast (
25- symbol: """
26- $s7Testing12__checkValue_10expression0D25WithCapturedRuntimeValues26mismatchedErrorDesc \
27- ription10difference8comments10isRequired14sourceLocations6ResultOyyts0J0_pGSb_AA12__Exp \
28- ressionVAOSgyXKSSSgyXKAQyXKSayAA7CommentVGyXKSbAA06SourceQ0VtF
29- """ ,
19+ let record = unsafeBitCast (
20+ symbol: " $s7Testing5IssueV6record_14sourceLocationAcA7CommentVSg_AA06SourceE0VtFZ " ,
3021 in: " Testing " ,
31- to: ( @convention( thin) (
32- Bool,
33- __Expression,
34- @autoclosure ( ) - > __Expression? ,
35- @autoclosure ( ) - > String? ,
36- @autoclosure ( ) - > String? ,
37- @autoclosure ( ) - > [ Any] ,
38- Bool,
39- SourceLocation
40- ) - > Result< Void, any Error> )
41- . self
22+ to: ( @convention( thin) ( Any? , SourceLocation) - > Issue) . self
4223 )
4324 else { return }
4425
45- let syntaxNode = fromSyntaxNode ( message ?? " " )
46- _ = checkValue (
47- false ,
48- syntaxNode,
49- nil ,
50- nil ,
51- nil ,
52- [ ] ,
53- false ,
26+ var comment : Any ?
27+ if let message {
28+ var c = UnsafeMutablePointer < Comment > . allocate ( capacity: 1 ) . pointee
29+ c. rawValue = message
30+ comment = c
31+ }
32+ _ = record (
33+ comment,
5434 SourceLocation ( fileID: fileID, _filePath: filePath, line: line, column: column)
5535 )
5636 #else
@@ -87,7 +67,7 @@ func _recordError(
8767 $s7Testing5IssueV6record__14sourceLocationACs5Error_p_AA7CommentVSgAA06SourceE0VtFZ
8868 """ ,
8969 in: " Testing " ,
90- to: ( @convention ( thin) ( any Error , Any? , SourceLocation) - > Any ) . self
70+ to: ( @convention ( thin) ( any Error , Any? , SourceLocation) - > Issue ) . self
9171 )
9272 else { return }
9373
@@ -310,19 +290,9 @@ func _currentTestIsNotNil() -> Bool {
310290 var runtimeValue : Value ?
311291 }
312292
313- private struct TypeInfo: Sendable {
314- enum _Kind : Sendable {
315- case type( _ type: Any . Type )
316- case nameOnly( fullyQualifiedComponents: [ String ] , unqualified: String , mangled: String ? )
317- }
318- var _kind : _Kind
319- }
320-
321- private struct SourceLocation: Sendable {
322- var fileID : String
323- var _filePath : String
324- var line : Int
325- var column : Int
293+ private struct Backtrace: Sendable {
294+ typealias Address = UInt64
295+ var addresses : [ Address ]
326296 }
327297
328298 private struct Comment: RawRepresentable, Sendable {
@@ -342,7 +312,48 @@ func _currentTestIsNotNil() -> Bool {
342312 var kind : Kind ?
343313 }
344314
345- private protocol Trait: Sendable { }
315+ private struct Confirmation: Sendable {
316+ protocol ExpectedCount: Sendable , RangeExpression< Int> { }
317+ }
318+
319+ private struct Expectation: Sendable {
320+ var evaluatedExpression : __Expression
321+ var mismatchedErrorDescription : String ?
322+ var differenceDescription : String ?
323+ var mismatchedExitConditionDescription : String ?
324+ var isPassing : Bool
325+ var isRequired : Bool
326+ var sourceLocation : SourceLocation
327+ }
328+
329+ private struct Issue: Sendable {
330+ enum Kind : Sendable {
331+ case unconditional
332+ indirect case expectationFailed( _ expectation: Expectation )
333+ indirect case confirmationMiscounted( actual: Int , expected: Int )
334+ indirect case confirmationOutOfRange( actual: Int , expected: any Confirmation . ExpectedCount )
335+ indirect case errorCaught( _ error: any Error )
336+ indirect case timeLimitExceeded( timeLimitComponents: ( seconds: Int64 , attoseconds: Int64 ) )
337+ case knownIssueNotRecorded
338+ case apiMisused
339+ case system
340+ }
341+ var kind : Kind
342+ var comments : [ Comment ]
343+ var sourceContext : SourceContext
344+ }
345+
346+ private struct SourceContext: Sendable {
347+ var backtrace : Backtrace ?
348+ var sourceLocation : SourceLocation ?
349+ }
350+
351+ private struct SourceLocation: Sendable {
352+ var fileID : String
353+ var _filePath : String
354+ var line : Int
355+ var column : Int
356+ }
346357
347358 struct Test: @unchecked Sendable {
348359 static var current: Self ? {
@@ -378,6 +389,16 @@ func _currentTestIsNotNil() -> Bool {
378389 }
379390 private var isSynthesized = false
380391 }
392+
393+ private protocol Trait: Sendable { }
394+
395+ private struct TypeInfo: Sendable {
396+ enum _Kind : Sendable {
397+ case type( _ type: Any . Type )
398+ case nameOnly( fullyQualifiedComponents: [ String ] , unqualified: String , mangled: String ? )
399+ }
400+ var _kind : _Kind
401+ }
381402#endif
382403
383404@usableFromInline
0 commit comments