package windtrap
Install
dune-project
Dependency
Authors
Maintainers
Sources
sha256=2241b294b24ed5d56ea8b834d296e6fabc5dbdd924a89f51c14b00da66c50a25
sha512=c6cf83028bb09d0f2afeb38fce6825620873a6bbeff4b5b77e928bc2fc69262d49fe341961cba2b451c9dc9bd0df414f06bb73020c7131b125c6abd85c6bc5dd
doc/windtrap.prop/Windtrap_prop/Arbitrary/index.html
Module Windtrap_prop.ArbitrarySource
Arbitrary values: generators bundled with printers. Used internally by Prop.check. Most users should use Testable values with Windtrap.prop instead.
Arbitrary values bundle generators with printers.
An Arbitrary.t combines a Gen.t with a printer for displaying counterexamples. Most users should use Testable values with Windtrap.prop instead of using this module directly.
An arbitrary value: generator + printer.
make ~gen ~print creates an arbitrary from a generator and printer.
Primitives
int_range low high generates integers in [low, high]. Shrinks toward value closest to 0 within range.
int32_range low high generates 32-bit integers in [low, high]. Shrinks toward value closest to 0l within range.
int64_range low high generates 64-bit integers in [low, high]. Shrinks toward value closest to 0L within range.
Containers
list arb generates lists. Shrinks toward empty and smaller elements.
quad a b c d generates 4-tuples.
Choice
oneof arbs picks one arbitrary uniformly at random. Uses the printer from the first element for all values.
oneofl ~print xs picks one element uniformly at random. Shrinks toward earlier elements in the list.
Transformers
map ~print f arb maps f over generated values. Requires new printer since type changes.
filter p arb filters shrink candidates to only those satisfying p. This does not filter generated values; use Prop.assume to discard invalid test cases during generation.