Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Does not catch unhandled exceptions? #71

Open
anentropic opened this issue Oct 27, 2022 · 0 comments
Open

Does not catch unhandled exceptions? #71

anentropic opened this issue Oct 27, 2022 · 0 comments

Comments

@anentropic
Copy link

I have a function I want to test which may raise Not_found

I have a test like:

let test_sample =
  test @@ fun () ->
    let* points = Sample.(list int) in
    let result = MyModule.my_func points in
    equal Comparator.int result [1;2;3]

When I run this as part of a test suite I just get this:

$ dune test
File "tests/dune", line 2, characters 8-14:
2 |  (names mytests)
            ^^^^^^
Fatal error: exception Not_found

I was expecting the test framework to catch and report unhandled exceptions - in a big test suite it's not clear which test has failed, or where.

I can add my own try/with in the test case but I was just wondering if this is expected behaviour or not?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant