jobjo / popper

Property-based testing at ease
ISC License
43 stars 1 forks source link

Exception is not caught in Sample.bind #61

Closed copy closed 3 years ago

copy commented 3 years ago

The following example fails with Fatal error: exception File "test.ml", line 2, characters 71-77: Assertion failed:

open Popper
let () = run (test (fun () -> Popper.Sample.bind Sample.bool (fun _ -> assert false)))
jobjo commented 3 years ago

Hi, I belive this was fixed in https://github.com/jobjo/popper/pull/50. Will soon release a new version.

copy commented 3 years ago

I believe there is still an issue. I can reproduce the above example with popper pinned to the latest commit (opam pin add --dev popper). It does work when removing the Popper.Sample.bind.

jobjo commented 3 years ago

Right, exceptions were only caught at the level of producing a Random.t Sample.t not in actually running the sample. Fixed in https://github.com/jobjo/popper/pull/63.