Contents

record(_:sourceLocation:)

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

Declaration

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

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