Module QCheck2.Tree
A tree represents a generated value and its successive shrunk values.
type 'a t
A tree of random generated values, where the root contains the value used for the test, and the sub-trees contain shrunk values (as trees, to be able to shrink several times a value) used if the test fails.
val root : 'a t -> 'a
root tree
returns the root value of the tree of generated valuest
.
val children : 'a t -> 'a t Stdlib.Seq.t
children tree
returns the direct sub-trees of the tree of generated valuest
.
val pp : ?depth:int -> (Stdlib.Format.formatter -> 'a -> unit) -> Stdlib.Format.formatter -> 'a t -> unit
pp ?depth pp_a ppf tree
pretty-prints the tree of generated valuestree
using the pretty-print formatterppf
. Values of type'a
will be printed using the given pretty-printerpp_a
.As a tree
t
can be potentially huge when fully evaluated, you can control the maximum depth the printer goes withdepth
.None
means "everything"0
means "only the root"1
means "the root and its direct shrinks"2
means "the root, its direct shrinks, and the shrinks of its shrinks"- etc.