Closed lasseporsch closed 1 year ago
This is intentional.
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).
@younata: I understand. I'd suggest fixing the documentation then. Here the syntax with the round brackets is still used.
Whoops. Sorry about the confusion. The documentation is fixed now.
What did you do?
Following the Documentation, I wanted to write a Quickspec that tests an async function. I've boiled it down to this minimal reproducible example:
The documentation says that when using Quick, there's no need to do anything to provide an async context - so I didn't.
What did you expect to happen?
I expected this to work as in the documentation.
What actually happened instead?
The code does not compile:
However, adding an additional pair of curly brackets fixes the build error:
So I guess either the async versions of
expect
should be corrected to match the documentation or the other way around.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
See the code example above.