Skip to content

Does not catch unhandled exceptions? #71

@anentropic

Description

@anentropic

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?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions