stedolan / crowbar

Property fuzzing for OCaml
MIT License
183 stars 28 forks source link

Make check_eq and friends return unit rather than test_result. #13

Closed stedolan closed 6 years ago

stedolan commented 6 years ago

Currently, tests return a test_result = (unit, unit printer) result. It's a bit annoying if you have many things to test, since you have to manually plumb the failures around.

This patch removes test_result, so that tests return unit. It's much easier to test a load of properties this way (see the test_uunf example). Functions like check_eq now raise an exception to indicate failure.

yomimono commented 6 years ago

Nice. I've wanted fail a few times too, thanks.

gasche commented 6 years ago

Yes, I just asked @yomimono about a fail this morning, please merge!