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
exception tests are not easy, because you can't just use equality (for instance, the string in Invalid_argument might not be specified).
If you don't have a specific idea in mind, I propose the following semantic and syntax:
(*$E <exn matcher> <code to test>*)
where <exn matcher>: exn -> bool pattern matches an exception, and <code to test>: 'a should raise an exception that is validated by <exn matcher>. A block (*$E f g *) would be encoded into
assert_bool "some message"
( try g; false with e -> f e )
The text was updated successfully, but these errors were encountered:
There hasn't been much need for E tests in Batteries, because there are especially compact patterns for that in simple tests, but I see no reason not to implement them.
exception tests are not easy, because you can't just use equality (for instance, the string in
Invalid_argument
might not be specified).If you don't have a specific idea in mind, I propose the following semantic and syntax:
where
<exn matcher>: exn -> bool
pattern matches an exception, and<code to test>: 'a
should raise an exception that is validated by<exn matcher>
. A block(*$E f g *)
would be encoded intoThe text was updated successfully, but these errors were encountered: