Hedgehog

Property-based testing with integrated shrinking for OCaml.

Hedgehog is a property-based testing library in the spirit of Haskell Hedgehog. It provides:

Quick example

  open Hedgehog

  let () =
    Property.check
      Property.(property Gen.(
        let* xs = list (Range.linear 0 100) (int (Range.linear 0 1000)) in
        return (fun () ->
          assert_ (List.rev (List.rev xs) = xs))))
    |> ignore

Guides

API reference