Skip to content

Commit 894fa8b

Browse files
committed
Remove mismatchedExitConditionDescription (obsolete)
1 parent 39a64d4 commit 894fa8b

File tree

4 files changed

+1
-25
lines changed

4 files changed

+1
-25
lines changed

Sources/Testing/ExitTests/ExitTest.swift

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -527,7 +527,6 @@ func callExitTest(
527527
expectedExitCondition.isApproximatelyEqual(to: result.exitStatus),
528528
expectationContext: expectationContext,
529529
mismatchedErrorDescription: nil,
530-
mismatchedExitConditionDescription: nil,
531530
comments: comments(),
532531
isRequired: isRequired,
533532
sourceLocation: sourceLocation

Sources/Testing/Expectations/Expectation.swift

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -32,13 +32,6 @@ public struct Expectation: Sendable {
3232
evaluatedExpression.differenceDescription
3333
}
3434

35-
/// A description of the exit condition that was expected to be matched.
36-
///
37-
/// If this expectation passed, the value of this property is `nil` because no
38-
/// exit test failed.
39-
@_spi(Experimental) @_spi(ForToolsIntegrationOnly)
40-
public var mismatchedExitConditionDescription: String?
41-
4235
/// Whether the expectation passed or failed.
4336
///
4437
/// An expectation is considered to pass when its condition evaluates to
@@ -102,7 +95,7 @@ extension Expectation {
10295
/// - Parameter expectation: The real expectation.
10396
public init(snapshotting expectation: borrowing Expectation) {
10497
self.evaluatedExpression = expectation.evaluatedExpression
105-
self.mismatchedErrorDescription = expectation.mismatchedErrorDescription ?? expectation.mismatchedExitConditionDescription
98+
self.mismatchedErrorDescription = expectation.mismatchedErrorDescription
10699
self.differenceDescription = expectation.differenceDescription
107100
self.isPassing = expectation.isPassing
108101
self.isRequired = expectation.isRequired

Sources/Testing/Expectations/ExpectationChecking+Macro.swift

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,6 @@
1717
/// contains information about `condition` and its subexpressions (if any.)
1818
/// - mismatchedErrorDescription: A description of the thrown error that did
1919
/// not match the expectation, if applicable.
20-
/// - mismatchedExitConditionDescription: A description of the exit condition
21-
/// of the child process that did not match the expectation, if applicable.
2220
/// - comments: An array of comments describing the expectation. This array
2321
/// may be empty.
2422
/// - isRequired: Whether or not the expectation is required. The value of
@@ -58,7 +56,6 @@ func check(
5856
_ condition: Bool,
5957
expectationContext: consuming __ExpectationContext,
6058
mismatchedErrorDescription: @autoclosure () -> String?,
61-
mismatchedExitConditionDescription: @autoclosure () -> String?,
6259
comments: @autoclosure () -> [Comment],
6360
isRequired: Bool,
6461
sourceLocation: SourceLocation
@@ -86,7 +83,6 @@ func check(
8683
// Since this expectation failed, populate its optional fields which are
8784
// only evaluated and included lazily upon failure.
8885
expectation.mismatchedErrorDescription = mismatchedErrorDescription()
89-
expectation.mismatchedExitConditionDescription = mismatchedExitConditionDescription()
9086

9187
// Ensure the backtrace is captured here so it has fewer extraneous frames
9288
// from the testing framework which aren't relevant to the user.
@@ -118,7 +114,6 @@ public func __checkCondition(
118114
condition,
119115
expectationContext: expectationContext,
120116
mismatchedErrorDescription: nil,
121-
mismatchedExitConditionDescription: nil,
122117
comments: comments(),
123118
isRequired: isRequired,
124119
sourceLocation: sourceLocation
@@ -144,7 +139,6 @@ public func __checkCondition<T>(
144139
optionalValue != nil,
145140
expectationContext: expectationContext,
146141
mismatchedErrorDescription: nil,
147-
mismatchedExitConditionDescription: nil,
148142
comments: comments(),
149143
isRequired: isRequired,
150144
sourceLocation: sourceLocation
@@ -180,7 +174,6 @@ public func __checkConditionAsync(
180174
condition,
181175
expectationContext: expectationContext,
182176
mismatchedErrorDescription: nil,
183-
mismatchedExitConditionDescription: nil,
184177
comments: comments(),
185178
isRequired: isRequired,
186179
sourceLocation: sourceLocation
@@ -207,7 +200,6 @@ public func __checkConditionAsync<T>(
207200
optionalValue != nil,
208201
expectationContext: expectationContext,
209202
mismatchedErrorDescription: nil,
210-
mismatchedExitConditionDescription: nil,
211203
comments: comments(),
212204
isRequired: isRequired,
213205
sourceLocation: sourceLocation
@@ -242,7 +234,6 @@ public func __checkEscapedCondition(
242234
condition,
243235
expectationContext: expectationContext,
244236
mismatchedErrorDescription: nil,
245-
mismatchedExitConditionDescription: nil,
246237
comments: comments(),
247238
isRequired: isRequired,
248239
sourceLocation: sourceLocation
@@ -270,7 +261,6 @@ public func __checkEscapedCondition<T>(
270261
optionalValue != nil,
271262
expectationContext: expectationContext,
272263
mismatchedErrorDescription: nil,
273-
mismatchedExitConditionDescription: nil,
274264
comments: comments(),
275265
isRequired: isRequired,
276266
sourceLocation: sourceLocation
@@ -397,7 +387,6 @@ public func __checkClosureCall(
397387
success,
398388
expectationContext: expectationContext,
399389
mismatchedErrorDescription: mismatchExplanationValue,
400-
mismatchedExitConditionDescription: nil,
401390
comments: comments(),
402391
isRequired: isRequired,
403392
sourceLocation: sourceLocation
@@ -436,7 +425,6 @@ public func __checkClosureCall(
436425
success,
437426
expectationContext: expectationContext,
438427
mismatchedErrorDescription: mismatchExplanationValue,
439-
mismatchedExitConditionDescription: nil,
440428
comments: comments(),
441429
isRequired: isRequired,
442430
sourceLocation: sourceLocation
@@ -546,7 +534,6 @@ public func __checkClosureCall<R>(
546534
errorMatches,
547535
expectationContext: expectationContext,
548536
mismatchedErrorDescription: mismatchExplanationValue,
549-
mismatchedExitConditionDescription: nil,
550537
comments: comments(),
551538
isRequired: isRequired,
552539
sourceLocation: sourceLocation
@@ -599,7 +586,6 @@ public func __checkClosureCall<R>(
599586
errorMatches,
600587
expectationContext: expectationContext,
601588
mismatchedErrorDescription: mismatchExplanationValue,
602-
mismatchedExitConditionDescription: nil,
603589
comments: comments(),
604590
isRequired: isRequired,
605591
sourceLocation: sourceLocation

Sources/Testing/Issues/Issue.swift

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -276,8 +276,6 @@ extension Issue.Kind: CustomStringConvertible {
276276
case let .expectationFailed(expectation):
277277
return if let mismatchedErrorDescription = expectation.mismatchedErrorDescription {
278278
"Expectation failed: \(mismatchedErrorDescription)"
279-
} else if let mismatchedExitConditionDescription = expectation.mismatchedExitConditionDescription {
280-
"Expectation failed: \(mismatchedExitConditionDescription)"
281279
} else {
282280
"Expectation failed: \(expectation.evaluatedExpression.expandedDescription())"
283281
}

0 commit comments

Comments
 (0)