package windtrap
Install
dune-project
Dependency
Authors
Maintainers
Sources
sha256=2241b294b24ed5d56ea8b834d296e6fabc5dbdd924a89f51c14b00da66c50a25
sha512=c6cf83028bb09d0f2afeb38fce6825620873a6bbeff4b5b77e928bc2fc69262d49fe341961cba2b451c9dc9bd0df414f06bb73020c7131b125c6abd85c6bc5dd
doc/windtrap.prop/Windtrap_prop/index.html
Module Windtrap_propSource
Property-based testing for Windtrap.
This library provides generators and a property runner for property-based testing. Use with the main Windtrap library for full test integration.
Quick Start
With the main Windtrap library, use Testable values directly for property testing:
open Windtrap
let () =
run "Properties"
[
prop "reverse is involutive"
Testable.(list int)
(fun l -> List.rev (List.rev l) = l);
prop "append length"
Testable.(pair (list int) (list int))
(fun (l1, l2) ->
List.length (l1 @ l2) = List.length l1 + List.length l2);
]Arbitrary values: generators bundled with printers. Used internally by Prop.check. Most users should use Testable values with Windtrap.prop instead.
assume b discards the current test case if b is false. Prefer constrained generators when possible, as excessive discarding causes the test to give up.
reject () unconditionally discards the current test case.
collect label records label for the current property case.
classify label cond records label when cond is true.
cover ~label ~at_least cond declares and checks a coverage requirement for label, and records a hit when cond is true.