Commit 15892d8
authored
Fix a crash when an issue is recorded on a detached task. (#592)
Given the following code:
```swift
@test func f() async {
await Task.detached {
#expect(1 == 2)
}.value
}
```
An issue is recorded on a detached task, but Swift Testing is unable to
determine at runtime which test it corresponds to. This should simply
result in the issue being attributed to an arbitrary test, or to the
aether, but #421 caused a regression that triggers an optional unwrap
crash instead.
This PR fixes the crash. :)
### 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 e4170a8 commit 15892d8
File tree
2 files changed
+19
-8
lines changed- Sources/Testing/Events/Recorder
- Tests/TestingTests
2 files changed
+19
-8
lines changedLines changed: 9 additions & 8 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
262 | 262 | | |
263 | 263 | | |
264 | 264 | | |
265 | | - | |
266 | | - | |
267 | | - | |
268 | | - | |
269 | | - | |
270 | | - | |
271 | | - | |
| 265 | + | |
| 266 | + | |
| 267 | + | |
| 268 | + | |
| 269 | + | |
| 270 | + | |
| 271 | + | |
| 272 | + | |
| 273 | + | |
272 | 274 | | |
273 | | - | |
274 | 275 | | |
275 | 276 | | |
276 | 277 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
359 | 359 | | |
360 | 360 | | |
361 | 361 | | |
| 362 | + | |
| 363 | + | |
| 364 | + | |
| 365 | + | |
| 366 | + | |
| 367 | + | |
| 368 | + | |
| 369 | + | |
| 370 | + | |
| 371 | + | |
362 | 372 | | |
363 | 373 | | |
364 | 374 | | |
| |||
0 commit comments