@@ -58,25 +58,6 @@ extension Issue {
58
58
return self
59
59
}
60
60
61
- /// Record an issue when a running test fails unexpectedly.
62
- ///
63
- /// - Parameters:
64
- /// - comment: A comment describing the expectation.
65
- /// - sourceLocation: The source location to which the issue should be
66
- /// attributed.
67
- ///
68
- /// - Returns: The issue that was recorded.
69
- ///
70
- /// Use this function if, while running a test, an issue occurs that cannot be
71
- /// represented as an expectation (using the ``expect(_:_:sourceLocation:)``
72
- /// or ``require(_:_:sourceLocation:)-5l63q`` macros.)
73
- @discardableResult public static func record(
74
- _ comment: Comment ? = nil ,
75
- sourceLocation: SourceLocation = #_sourceLocation
76
- ) -> Self {
77
- record ( comment, severity: . error, sourceLocation: sourceLocation)
78
- }
79
-
80
61
/// Record an issue when a running test fails unexpectedly.
81
62
///
82
63
/// - Parameters:
@@ -90,10 +71,9 @@ extension Issue {
90
71
/// Use this function if, while running a test, an issue occurs that cannot be
91
72
/// represented as an expectation (using the ``expect(_:_:sourceLocation:)``
92
73
/// or ``require(_:_:sourceLocation:)-5l63q`` macros.)
93
- @_spi ( Experimental)
94
74
@discardableResult public static func record(
95
75
_ comment: Comment ? = nil ,
96
- severity: Severity ,
76
+ severity: Severity = . error ,
97
77
sourceLocation: SourceLocation = #_sourceLocation
98
78
) -> Self {
99
79
let sourceContext = SourceContext ( backtrace: . current( ) , sourceLocation: sourceLocation)
@@ -105,28 +85,7 @@ extension Issue {
105
85
// MARK: - Recording issues for errors
106
86
107
87
extension Issue {
108
- /// Record a new issue when a running test unexpectedly catches an error.
109
- ///
110
- /// - Parameters:
111
- /// - error: The error that caused the issue.
112
- /// - comment: A comment describing the expectation.
113
- /// - sourceLocation: The source location to which the issue should be
114
- /// attributed.
115
- ///
116
- /// - Returns: The issue that was recorded.
117
- ///
118
- /// This function can be used if an unexpected error is caught while running a
119
- /// test and it should be treated as a test failure. If an error is thrown
120
- /// from a test function, it is automatically recorded as an issue and this
121
- /// function does not need to be used.
122
- @discardableResult public static func record(
123
- _ error: any Error ,
124
- _ comment: Comment ? = nil ,
125
- sourceLocation: SourceLocation = #_sourceLocation
126
- ) -> Self {
127
- record ( error, comment, severity: . error, sourceLocation: sourceLocation)
128
- }
129
-
88
+
130
89
/// Record a new issue when a running test unexpectedly catches an error.
131
90
///
132
91
/// - Parameters:
@@ -142,11 +101,10 @@ extension Issue {
142
101
/// test and it should be treated as a test failure. If an error is thrown
143
102
/// from a test function, it is automatically recorded as an issue and this
144
103
/// function does not need to be used.
145
- @_spi ( Experimental)
146
104
@discardableResult public static func record(
147
105
_ error: any Error ,
148
106
_ comment: Comment ? = nil ,
149
- severity: Severity ,
107
+ severity: Severity = . error ,
150
108
sourceLocation: SourceLocation = #_sourceLocation
151
109
) -> Self {
152
110
let backtrace = Backtrace ( forFirstThrowOf: error) ?? Backtrace . current ( )
0 commit comments