diff --git a/Sources/Testing/Issues/Issue+Recording.swift b/Sources/Testing/Issues/Issue+Recording.swift index bd3e9a3b..203ba036 100644 --- a/Sources/Testing/Issues/Issue+Recording.swift +++ b/Sources/Testing/Issues/Issue+Recording.swift @@ -58,25 +58,6 @@ extension Issue { return self } - /// Record an issue when a running test fails unexpectedly. - /// - /// - 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:)-5l63q`` macros.) - @discardableResult public static func record( - _ comment: Comment? = nil, - sourceLocation: SourceLocation = #_sourceLocation - ) -> Self { - record(comment, severity: .error, sourceLocation: sourceLocation) - } - /// Record an issue when a running test fails unexpectedly. /// /// - Parameters: @@ -90,10 +71,9 @@ extension Issue { /// 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:)-5l63q`` macros.) - @_spi(Experimental) @discardableResult public static func record( _ comment: Comment? = nil, - severity: Severity, + severity: Severity = .error, sourceLocation: SourceLocation = #_sourceLocation ) -> Self { let sourceContext = SourceContext(backtrace: .current(), sourceLocation: sourceLocation) @@ -105,28 +85,7 @@ extension Issue { // MARK: - Recording issues for errors extension Issue { - /// Record a new issue when a running test unexpectedly catches an error. - /// - /// - Parameters: - /// - error: The error that caused the issue. - /// - comment: A comment describing the expectation. - /// - sourceLocation: The source location to which the issue should be - /// attributed. - /// - /// - Returns: The issue that was recorded. - /// - /// This function can be used if an unexpected error is caught while running a - /// test and it should be treated as a test failure. If an error is thrown - /// from a test function, it is automatically recorded as an issue and this - /// function does not need to be used. - @discardableResult public static func record( - _ error: any Error, - _ comment: Comment? = nil, - sourceLocation: SourceLocation = #_sourceLocation - ) -> Self { - record(error, comment, severity: .error, sourceLocation: sourceLocation) - } - + /// Record a new issue when a running test unexpectedly catches an error. /// /// - Parameters: @@ -142,11 +101,10 @@ extension Issue { /// test and it should be treated as a test failure. If an error is thrown /// from a test function, it is automatically recorded as an issue and this /// function does not need to be used. - @_spi(Experimental) @discardableResult public static func record( _ error: any Error, _ comment: Comment? = nil, - severity: Severity, + severity: Severity = .error, sourceLocation: SourceLocation = #_sourceLocation ) -> Self { let backtrace = Backtrace(forFirstThrowOf: error) ?? Backtrace.current() diff --git a/Sources/Testing/Issues/Issue.swift b/Sources/Testing/Issues/Issue.swift index 53364c15..9cf734f0 100644 --- a/Sources/Testing/Issues/Issue.swift +++ b/Sources/Testing/Issues/Issue.swift @@ -84,7 +84,6 @@ public struct Issue: Sendable { /// /// - ``warning`` /// - ``error`` - @_spi(Experimental) public enum Severity: Sendable { /// The severity level for an issue which should be noted but is not /// necessarily an error. @@ -101,7 +100,6 @@ public struct Issue: Sendable { } /// The severity of this issue. - @_spi(Experimental) public var severity: Severity /// Whether or not this issue should cause the test it's associated with to be @@ -114,7 +112,6 @@ public struct Issue: Sendable { /// /// Use this property to determine if an issue should be considered a failure, instead of /// directly comparing the value of the ``severity`` property. - @_spi(Experimental) public var isFailure: Bool { return !self.isKnown && self.severity >= .error }