Skip to content

Commit 144f0c5

Browse files
authored
Update documentation for new confirmation() overload. (#784)
Follow-up to #691. Updates DocC links now that `confirmation()` is overloaded, specifies a minimum Swift version needed to use it, and adds content to "Migrating From XCTest" covering the new overload. ### Checklist: - [x] Code and documentation should follow the style of the [Style Guide](https://github.com/apple/swift-testing/blob/main/Documentation/StyleGuide.md). - [x] If public symbols are renamed or modified, DocC references should be updated.
1 parent 958f82e commit 144f0c5

File tree

6 files changed

+167
-141
lines changed

6 files changed

+167
-141
lines changed

Sources/Testing/Issues/Confirmation.swift

+4-4
Original file line numberDiff line numberDiff line change
@@ -160,7 +160,7 @@ public func confirmation<R>(
160160
/// preconditions have been met, and records an issue if they have not.
161161
///
162162
/// If an exact count is expected, use
163-
/// ``confirmation(_:expectedCount:isolation:sourceLocation:_:)`` instead.
163+
/// ``confirmation(_:expectedCount:isolation:sourceLocation:_:)-5mqz2`` instead.
164164
public func confirmation<R>(
165165
_ comment: Comment? = nil,
166166
expectedCount: some RangeExpression<Int> & Sequence<Int> & Sendable,
@@ -183,7 +183,7 @@ public func confirmation<R>(
183183
return try await body(confirmation)
184184
}
185185

186-
/// An overload of ``confirmation(_:expectedCount:isolation:sourceLocation:_:)-6bkl6``
186+
/// An overload of ``confirmation(_:expectedCount:isolation:sourceLocation:_:)-l3il``
187187
/// that handles the unbounded range operator (`...`).
188188
///
189189
/// This overload is necessary because `UnboundedRange` does not conform to
@@ -200,7 +200,7 @@ public func confirmation<R>(
200200
fatalError("Unsupported")
201201
}
202202

203-
/// An overload of ``confirmation(_:expectedCount:isolation:sourceLocation:_:)-6bkl6``
203+
/// An overload of ``confirmation(_:expectedCount:isolation:sourceLocation:_:)-l3il``
204204
/// that handles the partial-range-through operator (`...n`).
205205
///
206206
/// This overload is necessary because the lower bound of `PartialRangeThrough`
@@ -216,7 +216,7 @@ public func confirmation<R>(
216216
fatalError("Unsupported")
217217
}
218218

219-
/// An overload of ``confirmation(_:expectedCount:isolation:sourceLocation:_:)-6bkl6``
219+
/// An overload of ``confirmation(_:expectedCount:isolation:sourceLocation:_:)-l3il``
220220
/// that handles the partial-range-up-to operator (`..<n`).
221221
///
222222
/// This overload is necessary because the lower bound of `PartialRangeUpTo` is

Sources/Testing/Issues/Issue.swift

+4-4
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ public struct Issue: Sendable {
3333
/// ``Confirmation/confirm(count:)`` should have been called.
3434
///
3535
/// This issue can occur when calling ``confirmation(_:expectedCount:isolation:sourceLocation:_:)-5mqz2``
36-
/// or ``confirmation(_:expectedCount:isolation:sourceLocation:_:)-6bkl6``
36+
/// or ``confirmation(_:expectedCount:isolation:sourceLocation:_:)-l3il``
3737
/// when the confirmation passed to these functions' `body` closures is
3838
/// confirmed too few or too many times.
3939
indirect case confirmationMiscounted(actual: Int, expected: any RangeExpression & Sendable)
@@ -306,9 +306,9 @@ extension Issue.Kind {
306306
/// ``Confirmation/confirm(count:)`` should have been called.
307307
///
308308
/// This issue can occur when calling
309-
/// ``confirmation(_:expectedCount:isolation:sourceLocation:_:)`` when the
310-
/// confirmation passed to these functions' `body` closures is confirmed too
311-
/// few or too many times.
309+
/// ``confirmation(_:expectedCount:isolation:sourceLocation:_:)-5mqz2`` when
310+
/// the confirmation passed to these functions' `body` closures is confirmed
311+
/// too few or too many times.
312312
indirect case confirmationMiscounted(actual: Int, expected: Int)
313313

314314
/// An issue due to an `Error` being thrown by a test function and caught by
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
# ``Testing/confirmation(_:expectedCount:isolation:sourceLocation:_:)-l3il``
2+
3+
@Metadata {
4+
@Available(Swift, introduced: 6.1)
5+
}

Sources/Testing/Testing.docc/Expectations.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ the test when the code doesn't satisfy a requirement, use
7676

7777
- <doc:testing-asynchronous-code>
7878
- ``confirmation(_:expectedCount:isolation:sourceLocation:_:)-5mqz2``
79-
- ``confirmation(_:expectedCount:isolation:sourceLocation:_:)-6bkl6``
79+
- ``confirmation(_:expectedCount:isolation:sourceLocation:_:)-l3il``
8080
- ``Confirmation``
8181

8282
### Retrieving information about checked expectations

0 commit comments

Comments
 (0)