Closed AlexKobachiJP closed 1 year ago
use
await expect { await foo.bar() } == "Hello World"
instead.expect
with async closures does not have a version that uses autoclosures (the compiler would always assume you want the autoclosure is async, and thus raise compiler errors if you use Nimble in a synchronous context - I don't know if this has since been fixed).
Got it, thanks! Was about to raise PR but saw you already fixed it.
What did you do?
Try to add async test following https://github.com/Quick/Nimble/blob/1454547ea836dd852096e47b5eb1425479085880/README.md?plain=1#L308 which makes the async test look simple and clean:
What did you expect to happen?
I expected it to compile.
What actually happened instead?
It did not compile:
While the fixes is simple (wrap async call in closure), I am wondering:
async
versions ofexpect
don't offer@autoclosure
varieties? Is there a technical reason?I guess the main expectation would be for the
Readme
to show compiling code, but want to understand if there's a reason first.Environment
List the software versions you're using:
Please also mention which package manager you used and its version. Delete the other package managers in this list:
Project that demonstrates the issue