Skip to content

Commit b7ef61e

Browse files
committed
Remove "unconditional" messaging from Issue kind .unconditional.
This PR changes the default message for an issue of kind `.unconditional` from `"Unconditionally failed"` to `"Issue recorded"`. Although the failure is unconditional at the point it is recorded, the code that recorded the issue may not be unconditionally executing, so we shouldn't describe it as unconditional (we just don't know!) For example, given the following code: ```swift if case .empty = potatoSack.contents { Issue.record("No potatoes left.") } ``` We would previously log: > Unconditionally failed: No potatoes left. Now we'll log: > Issue recorded: No potatoes left. Resolves #574.
1 parent c314907 commit b7ef61e

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

Sources/Testing/Issues/Issue.swift

+5-2
Original file line numberDiff line numberDiff line change
@@ -171,7 +171,10 @@ extension Issue.Kind: CustomStringConvertible {
171171
public var description: String {
172172
switch self {
173173
case .unconditional:
174-
"Unconditionally failed"
174+
// Although the failure is unconditional at the point it is recorded, the
175+
// code that recorded the issue may not be unconditionally executing, so
176+
// we shouldn't describe it as unconditional (we just don't know!)
177+
"Issue recorded"
175178
case let .expectationFailed(expectation):
176179
if let mismatchedErrorDescription = expectation.mismatchedErrorDescription {
177180
"Expectation failed: \(mismatchedErrorDescription)"
@@ -457,7 +460,7 @@ extension Issue.Kind.Snapshot: CustomStringConvertible {
457460
public var description: String {
458461
switch self {
459462
case .unconditional:
460-
"Unconditionally failed"
463+
"Issue recorded"
461464
case let .expectationFailed(expectation):
462465
if let mismatchedErrorDescription = expectation.mismatchedErrorDescription {
463466
"Expectation failed: \(mismatchedErrorDescription)"

0 commit comments

Comments
 (0)