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.
closed_intervals_test.exscontains 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:orderand:eqas well. I have something like this in mind:This should be placed in a new module
generators/closed_intervals.ex, andmix.exsmust be extended to compile this module if the environment istestordev. We should then also add an example for the README to allow people finding this.