Module Preface_qcheck.Util

Some utilities to deal with QCheck.

val test : count:int -> ?print:'generated QCheck2.Print.t -> 'generated QCheck2.Gen.t -> (unit -> ('b, 'c) Preface_laws.Law.t) -> (('b -> 'c) -> ('b -> 'c) -> 'generated -> bool) -> QCheck2.Test.t

An helper to deal with test definition

Generators

Additional generators.

val gen_either : 'a QCheck2.Gen.t -> 'b QCheck2.Gen.t -> ('a, 'b) Stdlib.Either.t QCheck2.Gen.t
val gen_result : 'a QCheck2.Gen.t -> 'b QCheck2.Gen.t -> ('a, 'b) Stdlib.Result.t QCheck2.Gen.t
val gen_try : 'a QCheck2.Gen.t -> ('a, exn) Stdlib.Result.t QCheck2.Gen.t
val gen_exn : exn QCheck2.Gen.t

Additional observers

val obs_either : 'a QCheck2.Observable.t -> 'b QCheck2.Observable.t -> ('a, 'b) Stdlib.Either.t QCheck2.Observable.t
val obs_result : 'a QCheck2.Observable.t -> 'b QCheck2.Observable.t -> ('a, 'b) Stdlib.Result.t QCheck2.Observable.t
val obs_try : 'a QCheck2.Observable.t -> ('a, exn) Stdlib.Result.t QCheck2.Observable.t
val obs_exn : exn QCheck2.Observable.t

Pretty-printers

Additional pretty-printer.

val pp_either : (Stdlib.Format.formatter -> 'a -> unit) -> (Stdlib.Format.formatter -> 'b -> unit) -> Stdlib.Format.formatter -> ('a, 'b) Stdlib.Either.t -> unit
val pp_result : (Stdlib.Format.formatter -> 'a -> unit) -> (Stdlib.Format.formatter -> 'b -> unit) -> Stdlib.Format.formatter -> ('a, 'b) Stdlib.Result.t -> unit
val pp_try : (Stdlib.Format.formatter -> 'a -> unit) -> Stdlib.Format.formatter -> ('a, exn) Stdlib.Result.t -> unit
val pp_exn : Stdlib.Format.formatter -> exn -> unit

Equality

Additional equivalence function.

val equal_pair : ('a -> 'a -> bool) -> ('b -> 'b -> bool) -> ('a * 'b) -> ('a * 'b) -> bool
val equal_either : ('a -> 'a -> bool) -> ('b -> 'b -> bool) -> ('a, 'b) Stdlib.Either.t -> ('a, 'b) Stdlib.Either.t -> bool
val equal_exn : exn -> exn -> bool