You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Change default behavior of exit tests to always succeed. (#858)
Exit tests simulate calling `main()` (or some similar thing), but if you
don't explicitly exit from them, they force a failure. After much
mulling and some discussion with colleagues a while back, we should
change the behavior so that, if a test doesn't otherwise terminate, it
acts as if `main()` returned naturally—that is, by exiting with
`EXIT_SUCCESS` rather than by forcing `EXIT_FAILURE`. This behavior is
more consistent with the feature's theory of operation.
For example:
```swift
await #expect(exitsWith: .success) {
assert(2 > 1) // this is true and doesn't assert, so this test should pass, right?
}
```
Exit tests remain an experimental feature.
### 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.
0 commit comments