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
The Lwt test runner currently catches asynchronous exceptions in tests and triggers a test failure. This is nice functionality, but doesn't allow for the use of check_raises to write tests that expect asynchronous exceptions to be thrown. It's clearly possible to write a handler manually via something like this:
Lwt.catch
(fun() -> f ()>|=fun() -> `Ok)
(functione ->Lwt.return @@`Error e)
>|=function|`ErrorLib_exn -> Alcotest.(check pass) "Correct exception"()()|`Error_ -> Alcotest.fail "Incorrect exception was thrown"|`Ok -> Alcotest.fail "No exception was thrown"
but it seems to me that it would be nice for alcotest-lwt to provide users with an asynchronous variant of check_raises that hides this boilerplate.
It might be possible to solve #88 at the same time by changing the exception-handling API altogether.
The text was updated successfully, but these errors were encountered:
The Lwt test runner currently catches asynchronous exceptions in tests and triggers a test failure. This is nice functionality, but doesn't allow for the use of
check_raises
to write tests that expect asynchronous exceptions to be thrown. It's clearly possible to write a handler manually via something like this:but it seems to me that it would be nice for
alcotest-lwt
to provide users with an asynchronous variant ofcheck_raises
that hides this boilerplate.It might be possible to solve #88 at the same time by changing the exception-handling API altogether.
The text was updated successfully, but these errors were encountered: