24
24
///
25
25
/// - ``Trait/compactMapIssues(_:)``
26
26
/// - ``Trait/filterIssues(_:)``
27
- @_spi ( Experimental)
27
+ ///
28
+ /// @Metadata {
29
+ /// @Available(Swift, introduced: 6.2)
30
+ /// }
28
31
public struct IssueHandlingTrait : TestTrait , SuiteTrait {
29
32
/// A function which handles an issue and returns an optional replacement.
30
33
///
@@ -49,6 +52,10 @@ public struct IssueHandlingTrait: TestTrait, SuiteTrait {
49
52
///
50
53
/// - Returns: An issue to replace `issue`, or else `nil` if the issue should
51
54
/// not be recorded.
55
+ ///
56
+ /// @Metadata {
57
+ /// @Available(Swift, introduced: 6.2)
58
+ /// }
52
59
public func handleIssue( _ issue: Issue ) -> Issue ? {
53
60
_handler ( issue)
54
61
}
@@ -58,6 +65,9 @@ public struct IssueHandlingTrait: TestTrait, SuiteTrait {
58
65
}
59
66
}
60
67
68
+ /// @Metadata {
69
+ /// @Available(Swift, introduced: 6.2)
70
+ /// }
61
71
extension IssueHandlingTrait : TestScoping {
62
72
public func scopeProvider( for test: Test , testCase: Test . Case ? ) -> Self ? {
63
73
// Provide scope for tests at both the suite and test case levels, but not
@@ -126,7 +136,6 @@ extension IssueHandlingTrait: TestScoping {
126
136
}
127
137
}
128
138
129
- @_spi ( Experimental)
130
139
extension Trait where Self == IssueHandlingTrait {
131
140
/// Constructs an trait that transforms issues recorded by a test.
132
141
///
@@ -158,6 +167,10 @@ extension Trait where Self == IssueHandlingTrait {
158
167
/// - Note: `transform` will never be passed an issue for which the value of
159
168
/// ``Issue/kind`` is ``Issue/Kind/system``, and may not return such an
160
169
/// issue.
170
+ ///
171
+ /// @Metadata {
172
+ /// @Available(Swift, introduced: 6.2)
173
+ /// }
161
174
public static func compactMapIssues( _ transform: @escaping @Sendable ( Issue ) -> Issue ? ) -> Self {
162
175
Self ( handler: transform)
163
176
}
@@ -192,6 +205,10 @@ extension Trait where Self == IssueHandlingTrait {
192
205
///
193
206
/// - Note: `isIncluded` will never be passed an issue for which the value of
194
207
/// ``Issue/kind`` is ``Issue/Kind/system``.
208
+ ///
209
+ /// @Metadata {
210
+ /// @Available(Swift, introduced: 6.2)
211
+ /// }
195
212
public static func filterIssues( _ isIncluded: @escaping @Sendable ( Issue ) -> Bool ) -> Self {
196
213
Self { issue in
197
214
isIncluded ( issue) ? issue : nil
0 commit comments