Commit 7895995
authored
Remove the
This PR replaces uses of `Confirmation.ExpectedCount` in our API surface
with `RangeExpression<Int> & Sendable`. A composed protocol type `P<A> &
Q` can only be expressed as `some`, not `any` as the latter is not yet
implemented in the compiler (rdar://96960993), so we were using a
separate protocol in place of that combination.
The downside of doing so is that it makes the legibility of the
interface worse. Xcode and other IDEs will offer you
`confirmation(expectedCount: Confirmation.ExpectedCount)` but don't tell
you that you need to write some range expression such as `0...2`. You
have to dig into the protocol definition/documentation to figure it out.
So this change changes the signature of the experimental
`confirmation()` overload to take a `some RangeExpression<Int> &
Sendable` and plumbs that through everywhere it's valid. Once we get to
generating an `Issue`, we need an existential box (`any`) at which point
we will just drop the `<Int>` bit until the compiler feature is added.
We have a parameterized unit test that takes an array of these values,
so to keep it building and passing, I moved a copy of the
`ExpectedCount` protocol to the fixtures section of the test file
containing that test; it's present only in our test target and not in
our API surface.
### 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.Confirmation.ExpectedCount marker protocol. (#689)1 parent fc35539 commit 7895995
File tree
3 files changed
+25
-37
lines changed- Sources/Testing/Issues
- Tests/TestingTests
3 files changed
+25
-37
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
164 | 164 | | |
165 | 165 | | |
166 | 166 | | |
167 | | - | |
| 167 | + | |
168 | 168 | | |
169 | 169 | | |
170 | 170 | | |
| |||
200 | 200 | | |
201 | 201 | | |
202 | 202 | | |
203 | | - | |
204 | | - | |
205 | | - | |
206 | | - | |
207 | | - | |
208 | | - | |
209 | | - | |
210 | | - | |
211 | | - | |
212 | | - | |
213 | | - | |
214 | | - | |
215 | | - | |
216 | | - | |
217 | | - | |
218 | | - | |
| 203 | + | |
219 | 204 | | |
220 | 205 | | |
221 | 206 | | |
| |||
233 | 218 | | |
234 | 219 | | |
235 | 220 | | |
236 | | - | |
237 | | - | |
238 | | - | |
239 | | - | |
240 | | - | |
241 | | - | |
242 | | - | |
243 | | - | |
244 | | - | |
245 | | - | |
246 | | - | |
247 | | - | |
248 | | - | |
249 | | - | |
250 | | - | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
52 | 52 | | |
53 | 53 | | |
54 | 54 | | |
55 | | - | |
| 55 | + | |
56 | 56 | | |
57 | 57 | | |
58 | 58 | | |
| |||
246 | 246 | | |
247 | 247 | | |
248 | 248 | | |
249 | | - | |
250 | | - | |
| 249 | + | |
| 250 | + | |
| 251 | + | |
| 252 | + | |
| 253 | + | |
| 254 | + | |
| 255 | + | |
| 256 | + | |
251 | 257 | | |
252 | 258 | | |
253 | 259 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
116 | 116 | | |
117 | 117 | | |
118 | 118 | | |
119 | | - | |
| 119 | + | |
120 | 120 | | |
121 | 121 | | |
122 | 122 | | |
123 | 123 | | |
124 | 124 | | |
125 | 125 | | |
126 | | - | |
| 126 | + | |
127 | 127 | | |
128 | 128 | | |
129 | 129 | | |
130 | 130 | | |
131 | 131 | | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
0 commit comments