@@ -49,6 +49,7 @@ The `Severity` enum:
49
49
``` swift
50
50
extension Issue {
51
51
// ...
52
+
52
53
public enum Severity : Codable , Comparable , CustomStringConvertible , Sendable {
53
54
/// The severity level for an issue which should be noted but is not
54
55
/// necessarily an error.
@@ -63,7 +64,6 @@ extension Issue {
63
64
/// marked as a failure.
64
65
case error
65
66
}
66
- // ...
67
67
}
68
68
```
69
69
@@ -78,6 +78,9 @@ Issue.record("My comment", severity: .warning)
78
78
Here is the ` Issue.record ` method definition with severity as a parameter.
79
79
80
80
``` swift
81
+ extension Issue {
82
+ // ...
83
+
81
84
/// Record an issue when a running test and an issue occurs.
82
85
///
83
86
/// - Parameters:
@@ -96,8 +99,7 @@ Here is the `Issue.record` method definition with severity as a parameter.
96
99
severity : Severity = .error ,
97
100
sourceLocation : SourceLocation = #_sourceLocation
98
101
) -> Self
99
-
100
- // ...
102
+ }
101
103
```
102
104
103
105
### Issue Type Enhancements
@@ -107,13 +109,11 @@ The Issue type is enhanced with two new properties to better handle and report i
107
109
- ` severity ` : This property allows access to the specific severity level of an issue, enabling more precise handling of test results.
108
110
109
111
``` swift
110
- // ...
111
-
112
112
extension Issue {
113
+ // ...
113
114
114
- /// The severity of the issue.
115
- public var severity: Severity { get set }
116
-
115
+ /// The severity of the issue.
116
+ public var severity: Severity { get set }
117
117
}
118
118
119
119
```
@@ -141,11 +141,10 @@ extension Issue {
141
141
Example usage of ` severity ` and ` isFailure ` :
142
142
143
143
``` swift
144
- // ...
145
144
withKnownIssue {
146
145
// ...
147
146
} matching : { issue in
148
- return issue.isFailure || issue.severity > .warning
147
+ issue.isFailure || issue.severity > .warning
149
148
}
150
149
```
151
150
0 commit comments