@@ -72,6 +72,30 @@ To enable test authors to log non-failing issues without affecting test results,
7272Issue.record (" My comment" , severity : .warning )
7373```
7474
75+ Here is the ` Issue.record ` method definition with severity as a parameter.
76+ ``` swift
77+ /// Record an issue when a running test fails unexpectedly.
78+ ///
79+ /// - Parameters:
80+ /// - comment: A comment describing the expectation.
81+ /// - severity: The severity of the issue.
82+ /// - sourceLocation: The source location to which the issue should be
83+ /// attributed.
84+ ///
85+ /// - Returns: The issue that was recorded.
86+ ///
87+ /// Use this function if, while running a test, an issue occurs that cannot be
88+ /// represented as an expectation (using the ``expect(_:_:sourceLocation:)``
89+ /// or ``require(_:_:sourceLocation:)-5l63q`` macros.)
90+ @discardableResult public static func record (
91+ _ comment : Comment? = nil ,
92+ severity : Severity = .error ,
93+ sourceLocation : SourceLocation = #_sourceLocation
94+ ) -> Self
95+
96+ // ...
97+ ```
98+
7599###Issue Type Enhancements
76100
77101The Issue type is enhanced with two new properties to better handle and report issues:
@@ -80,13 +104,18 @@ The Issue type is enhanced with two new properties to better handle and report i
80104``` swift
81105// ...
82106
107+ extension Issue {
108+
83109/// The severity of the issue.
84- public var severity: Severity
110+ public var severity: Severity { get set }
111+
112+ }
85113
86114```
87115- ` isFailure ` : A boolean property to determine if an issue results in a test failure, thereby helping in result aggregation and reporting.
88116``` swift
89- // ...
117+ extension Issue {
118+ // ...
90119
91120 /// Whether or not this issue should cause the test it's associated with to be
92121 /// considered a failure.
@@ -98,7 +127,8 @@ public var severity: Severity
98127 ///
99128 /// Use this property to determine if an issue should be considered a failure, instead of
100129 /// directly comparing the value of the ``severity`` property.
101- public var isFailure: Bool
130+ public var isFailure: Bool { get }
131+ }
102132```
103133
104134Example usage of ` severity ` and `isFailure:
0 commit comments