LinThis module allows the user to describe the type signature of a tested module interface using a DSL of type combinators.
module Internal : sig ... endInternal module to build test representations. This module is exposed for internal uses only, its API may change at any time.
Type definition to denote whether a described type can be deconstructed, i.e., tested for equality.
Type definition to denote that a described type can be composed with other combinators such as list.
Type definition to denote that a described type cannot be composed with other combinators such as list.
Type definition for type-describing combinators. (typ,con,styp,comb) ty represents a type typ and with an underlying state of type styp. The con type parameter indicates whether the combinator type is constructible or deconstructible. The comb type parameter indicates whether the combinator type is combinable or noncombinable.
val gen :
'a QCheck.arbitrary ->
('a -> string) ->
('a, constructible, 's, combinable) tygen arb to_str builds a constructible and combinable type combinator from a QCheck generator arb and a to-string function to_str.
val deconstructible :
('a -> string) ->
('a -> 'a -> bool) ->
('a, deconstructible, 's, combinable) tydeconstructible to_str eq builds a deconstructible and combinable type combinator from a to-string function to_str and an equality predicate eq.
val gen_deconstructible :
'a QCheck.arbitrary ->
('a -> string) ->
('a -> 'a -> bool) ->
('a, 'c, 's, combinable) tygen_deconstructible arb to_str eq builds a combinable type combinator from a QCheck generator arb, a to-string function to_str and an equality predicate eq.
val unit : (unit, 'a, 'b, combinable) tyThe unit combinator represents the unit type
val bool : (bool, 'a, 'b, combinable) tyThe bool combinator represents the bool type
val char : (char, 'a, 'b, combinable) tyThe char combinator represents the char type. It uses a uniform generator based on QCheck.char.
val char_printable : (char, 'a, 'b, combinable) tyThe char_printable combinator represents the char type. The generated characters have character codes 32-126 or 10 (newline) and are based on QCheck.printable_char.
val nat_small : (int, 'a, 'b, combinable) tyThe nat_small combinator represents the int type. The generated integers are non-negative, less than 100, and are based on QCheck.small_nat.
val int : (int, 'a, 'b, combinable) tyThe int combinator represents the int type. It uses a uniform generator based on QCheck.int.
val int_small : (int, 'a, 'b, combinable) tyThe int_small combinator represents the int type. The generated integers are non-negative and are based on QCheck.small_int.
val int_pos : (int, 'a, 'b, combinable) tyThe int_pos combinator represents the int type. The generated integers are non-negative and uniformly distributed. It is based on QCheck.pos_int.
val int_bound : int -> (int, 'a, 'b, combinable) tyThe int_bound b combinator represents the int type. The generated integers range from 0 to b, inclusive. It uses a uniform generator based on QCheck.int_bound.
Note: the result of int_bound my_bound cannot be used both as an argument type and as a result type in type signature descriptions.
val int32 : (Stdlib.Int32.t, 'a, 'b, combinable) tyThe int32 combinator represents the int32 type. It uses a uniform generator based on QCheck.int32.
val int64 : (Stdlib.Int64.t, 'a, 'b, combinable) tyThe int64 combinator represents the int64 type. It uses a uniform generator based on QCheck.int64.
val nat64_small : (Stdlib.Int64.t, 'a, 'b, combinable) tyThe nat64_small combinator represents the int64 type. The generated integers are non-negative and are based on QCheck.small_nat.
val float : (float, 'a, 'b, combinable) tyThe float combinator represents the float type. The generated floating point numbers do not include nan and infinities. It is based on QCheck.float.
val string : (Stdlib.String.t, 'a, 'b, combinable) tyThe string combinator represents the string type. The generated strings have a size generated from QCheck.Gen.nat and characters resulting from QCheck.Gen.char. It is based on QCheck.string.
val string_small : (Stdlib.String.t, 'a, 'b, combinable) tyThe string_small combinator represents the string type. The generated strings have a size generated from QCheck.Gen.small_nat and characters resulting from QCheck.Gen.char. It is based on QCheck.small_string.
val string_small_printable : (Stdlib.String.t, 'a, 'b, combinable) tyThe string_small_printable combinator represents the string type. The generated strings have a size generated from QCheck.Gen.small_nat and characters resulting from QCheck.Gen.printable. It is based on QCheck.small_printable_string.
val bytes : (Stdlib.Bytes.t, 'a, 'b, combinable) tyThe bytes combinator represents the bytes type. The generated byte strings have a size generated from QCheck.Gen.nat and characters resulting from QCheck.Gen.char. It is based on QCheck.bytes.
val bytes_small : (Stdlib.Bytes.t, 'a, 'b, combinable) tyThe bytes_small combinator represents the bytes type. The generated byte strings have a size generated from QCheck.Gen.small_nat and characters resulting from QCheck.Gen.char. It is based on QCheck.bytes_small.
val bytes_small_printable : (Stdlib.Bytes.t, 'a, 'b, combinable) tyThe bytes_small_printable combinator represents the string type. The generated byte strings have a size generated from QCheck.Gen.small_nat and characters resulting from QCheck.Gen.printable. It is based on QCheck.bytes_small_of.
val option :
?ratio:float ->
('a, 'c, 's, combinable) ty ->
('a option, 'c, 's, combinable) tyThe option combinator represents the option type. The generated values from option t are either Some v or None with v being generated by the t combinator. An optional ratio allows to change the default 0.85 Somes. It is based on QCheck.option.
val opt :
?ratio:float ->
('a, 'b, 'c, combinable) ty ->
('a option, 'b, 'c, combinable) tyThe opt combinator is an alias for option.
val list : ('a, 'c, 's, combinable) ty -> ('a list, 'c, 's, combinable) tyThe list combinator represents the list type. The generated lists from list t have a length resulting from QCheck.Gen.nat and have their elements generated by the t combinator. It is based on QCheck.list.
val array : ('a, 'c, 's, combinable) ty -> ('a array, 'c, 's, combinable) tyThe array combinator represents the array type. The generated arrays from array t have a length resulting from QCheck.Gen.nat and have their elements generated by the t combinator. It is based on QCheck.array.
val seq :
('a, 'c, 's, combinable) ty ->
('a Stdlib.Seq.t, 'c, 's, combinable) tyThe seq combinator represents the Stdlib.Seq.t type. The generated sequences from seq t have a length resulting from QCheck.Gen.nat and have their elements generated by the t combinator.
val t : ('a, constructible, 'a, noncombinable) tyThe t combinator represents the type Spec.t of the system under test.
val state : ('a, constructible, 'a, noncombinable) tyThe state combinator represents the type Spec.t of the system under test. It is an alias for the t combinator.
val or_exn :
('a, deconstructible, 'b, combinable) ty ->
(('a, exn) Stdlib.result, deconstructible, 'c, combinable) tyThe or_exn combinator transforms a result type representing t into a (t, exn) result type.
print_result pa pb creates a to-string function for a (a,b) result type given two to-string functions for as and bs, respectively.
val print : ('a, 'c, 's, 'comb) ty -> 'a -> stringGiven a description of type 'a, print a value of type 'a.
val equal : ('a, deconstructible, 's, 'comb) ty -> 'a -> 'a -> boolGiven a description of type 'a, compare two values of type 'a.
module Fun : sig ... endval returning : ('a, deconstructible, 'b, combinable) ty -> ('a, 'a, 'b) Fun.fnreturning t represents a pure return type.
val returning_or_exc :
('a, deconstructible, 'b, combinable) ty ->
('a, ('a, exn) Stdlib.result, 'b) Fun.fnreturning_or_exc t represents a return type of a function that may raise an exception.
returning_ t represents a return type that should be ignored.
returning_or_exc_ t represents a return type that should be ignored of a function that may raise an exception.
val (@->) :
('a, constructible, 'b, 'c) ty ->
('d, 'e, 'b) Fun.fn ->
('a -> 'd, 'e, 'b) Fun.fnat @-> rt represents a function type expecting an argument at and returning rt.
type 's api = (int * 's elem) listThe type of module signatures
val_ str f sig describes a function signature from a string str, a function value f, and a signature description sig.
val_freq w str f sig describes a function signature like val_ str f sig but with relative weight w rather than 1. A function of weight 2 will have twice the probability of being invoked compared to a function of weight 1.
module type Spec = sig ... endThe required description of a module signature
module MakeCmd (Spec : Spec) : Internal.CmdSpecFunctor to map a combinator-based module signature description into a raw Lin description. This functor is exposed for internal uses only, its API may change at any time.