Skip to content

Commit c13feaf

Browse files
authored
[6.1] Note in documentation when #expect(throws:) started returning a value. (#990)
- **Explanation**: Update documentation for modified macros to indicate how they've changed in 6.1. - **Scope**: Documentation - **Issues**: N/A - **Original PRs**: #980 - **Risk**: None - **Testing**: N/A - **Reviewers**: @briancroom @iamleeg @stmontgomery
1 parent a27e557 commit c13feaf

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

Sources/Testing/Expectations/Expectation+Macro.swift

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -160,6 +160,9 @@ public macro require<T>(
160160
/// is running in the current task. Any value returned by `expression` is
161161
/// discarded.
162162
///
163+
/// - Note: If you use this macro with a Swift compiler version lower than 6.1,
164+
/// it doesn't return a value.
165+
///
163166
/// If the thrown error need only equal another instance of [`Error`](https://developer.apple.com/documentation/swift/error),
164167
/// use ``expect(throws:_:sourceLocation:performing:)-7du1h`` instead.
165168
///
@@ -224,6 +227,9 @@ public macro require<T>(
224227
/// is running in the current task and an instance of ``ExpectationFailedError``
225228
/// is thrown. Any value returned by `expression` is discarded.
226229
///
230+
/// - Note: If you use this macro with a Swift compiler version lower than 6.1,
231+
/// it doesn't return a value.
232+
///
227233
/// If the thrown error need only equal another instance of [`Error`](https://developer.apple.com/documentation/swift/error),
228234
/// use ``require(throws:_:sourceLocation:performing:)-4djuw`` instead.
229235
///
@@ -286,6 +292,9 @@ public macro require<R>(
286292
/// not equal to `error`, an ``Issue`` is recorded for the test that is running
287293
/// in the current task. Any value returned by `expression` is discarded.
288294
///
295+
/// - Note: If you use this macro with a Swift compiler version lower than 6.1,
296+
/// it doesn't return a value.
297+
///
289298
/// If the thrown error need only be an instance of a particular type, use
290299
/// ``expect(throws:_:sourceLocation:performing:)-1hfms`` instead.
291300
@discardableResult
@@ -327,6 +336,9 @@ public macro require<R>(
327336
/// in the current task and an instance of ``ExpectationFailedError`` is thrown.
328337
/// Any value returned by `expression` is discarded.
329338
///
339+
/// - Note: If you use this macro with a Swift compiler version lower than 6.1,
340+
/// it doesn't return a value.
341+
///
330342
/// If the thrown error need only be an instance of a particular type, use
331343
/// ``require(throws:_:sourceLocation:performing:)-7n34r`` instead.
332344
@discardableResult

0 commit comments

Comments
 (0)