swiftlang / swift-testing

A modern, expressive testing package for Swift
Apache License 2.0
1.81k stars 77 forks source link

Do not perform full expansion of `#expect()` when `try` or `await` is present. #790

Closed grynspan closed 3 weeks ago

grynspan commented 3 weeks ago

For reasons that have been documented at length (see #162), we aren't able to correctly expand conditions on #expect() or #require() that have effects (try or await.) We aren't currently detecting all possible patterns that expand incorrectly. This PR causes us to back out of the full expansion if the try or await keyword is present anywhere inside an expectation condition expression.

Resolves #783.

Checklist:

grynspan commented 3 weeks ago

@swift-ci test

grynspan commented 3 weeks ago

@swift-ci test

grynspan commented 3 weeks ago

@swift-ci test Windows