Contents

record(_:severity:sourceLocation:)

Records an issue that a test encounters while it’s running.

Declaration

@discardableResult static func record(_ comment: Comment? = nil, severity: Issue.Severity = .error, sourceLocation: SourceLocation = #_sourceLocation) -> Issue

Parameters

  • comment:

    A comment describing the expectation.

  • severity:

    The severity level of the issue. The testing library marks the test as failed if the severity is greater than Warning. The default is Error.

  • sourceLocation:

    The source location to which the issue should be attributed.

Mentioned in

Return Value

The issue that was recorded.

Discussion

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.)