Library
Module
Module type
Parameter
Class
Class type
val qcheck_wrap : QCheck.Test.t list -> unit Alcotest.test_case list
Wrap QCheck tests into Alcotests.
val qcheck_eq :
?pp:(Stdlib.Format.formatter -> 'a -> unit) ->
?cmp:('a -> 'a -> int) ->
?eq:('a -> 'a -> bool) ->
'a ->
'a ->
bool
qcheck_eq pp cmp eq a b
evaluates whether a
and b
are equal, and if they are not, raises a failure and prints an error message. Equality is evaluated as follows:
eq
eq
is provided, use a provided cmp
eq
nor cmp
is provided, use Stdlib.compare
If pp
is provided, use this to print x
and y
if they are not equal.
val qcheck_eq' :
?pp:(Stdlib.Format.formatter -> 'a -> unit) ->
?cmp:('a -> 'a -> int) ->
?eq:('a -> 'a -> bool) ->
expected:'a ->
actual:'a ->
unit ->
bool
Labeled variant of qcheck_eq
. The unit
argument is necessary as OCaml requires at least one positional (non-labeled) argument in case of optional arguments.
int64_range a b
generates an int64
between a
inclusive and b
inclusive.
Poorman's implementation until https://github.com/c-cube/qcheck/issues/105 is done.
This probably spectacularly crashes if (b - a) > Int64.max_int
.
of_option_gen gen
converts a generator gen
of optional values into a generator of values by rerunning the generator if the generated value was a None
until a Some
is generated.
Be careful: if None
is always returned, this hangs forever!
of_option_arb arb
converts an arbitrary arb
of optional values into an arbitrary of values.
of_option_gen
(retries on None
values until a Some
is generated).None
values.Be careful: if None
is always returned, this hangs forever!