Static Methodswift-testing 6.0.2Testing
record(_:sourceLocation:)
Record an issue when a running test fails unexpectedly.
Issue+Recording.swift:110@discardableResult static func record(_ comment: Comment? = nil, sourceLocation: SourceLocation = #_sourceLocation) -> Issue
Parameters
- comment
A comment describing the expectation.
- sourceLocation
The source location to which the issue should be attributed.
Returns
The issue that was recorded.
Use this function if, while running a test, an issue occurs that cannot be represented as an expectation (using the expect(_:_:sourceLocation:)
or require(_:_:sourceLocation:)
macros.)
Other members in extension
Types
enum Kind
Kinds of issues which may be recorded.
Type members
static func record(any Error, Comment?, sourceLocation: SourceLocation
) -> Issue Record a new issue when a running test unexpectedly catches an error.
Instance members
var comments: [Comment]
Any comments provided by the developer and associated with this issue.
var debugDescription: String
var description: String
var error: (any Error)?
The error which was associated with this issue, if any.
var kind: Kind
The kind of issue this value represents.
var sourceLocation: SourceLocation?
The location in source where this issue occurred, if available.
Show system interfaces (2)
Hide system interfaces
var isKnown: Bool
Whether or not this issue is known to occur.
var sourceContext: SourceContext
A
SourceContext
indicating where and how this issue occurred.