Skip to content

Export PropCheck generators in test and dev environment #14

@evnu

Description

@evnu

closed_intervals_test.exs contains a simple PropCheck generator. It would be nice to make that available to downstream users. We probably need to allow a user to pass in a generator for interval values into this generator, in order to make it work with arbitrary data. This probably includes passing in :order and :eq as well. I have something like this in mind:

def gen_closed_intervals(values_gen, order, eq) do
  let [first <- values_gen, second <- values_gen, more <- list(values_gen)] do
    ClosedIntervals.from([first, second | more], order: order, eq: eq)
  end
end

This should be placed in a new module generators/closed_intervals.ex, and mix.exs must be extended to compile this module if the environment is test or dev. We should then also add an example for the README to allow people finding this.

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