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

Improve handling of discarded tests #50

Merged
merged 1 commit into from
Jun 17, 2021
Merged

Improve handling of discarded tests #50

merged 1 commit into from
Jun 17, 2021

Conversation

jobjo
Copy link
Owner

@jobjo jobjo commented Jun 15, 2021

A few things:

  1. Add a configuration max_num_discarded for specifying that a property-based test fails if it exceeds the threshold for the number of discarded items.

  2. Expose missing Popper.discard function.

  3. Improve printing of discarded unit test.

  4. Change the number of samples for the test target to 1000.

Example:

let config = Config.max_num_discarded 50
let () =
  check ~config (fun () ->
    let* b = Sample.bool in
    if b then pass else discard)

Results in:

image

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

Successfully merging this pull request may close these issues.

1 participant