QCheck.Test
Module related to individual tests. Since 0.18 most of it moved to QCheck2
, and the type 'a cell
was made a private implementation detail.
type 'a event = 'a QCheck2.Test.event =
type 'a cell = 'a QCheck2.Test.cell
type 'a handler = 'a QCheck2.Test.handler
type 'a step = 'a QCheck2.Test.step
type 'a callback = 'a QCheck2.Test.callback
type t = QCheck2.Test.t
Format version of fail_report
val make_cell :
?if_assumptions_fail:([ `Fatal | `Warning ] * float) ->
?count:int ->
?long_factor:int ->
?negative:bool ->
?max_gen:int ->
?max_fail:int ->
?small:('a -> int) ->
?retries:int ->
?name:string ->
'a arbitrary ->
('a -> bool) ->
'a cell
make_cell arb prop
builds a test that checks property prop
on instances of the generator arb
.
val get_law : 'a cell -> 'a -> bool
val get_name : _ cell -> string
val set_name : _ cell -> string -> unit
val get_count : _ cell -> int
Get the count of a cell.
val get_long_factor : _ cell -> int
Get the long factor of a cell.
val make :
?if_assumptions_fail:([ `Fatal | `Warning ] * float) ->
?count:int ->
?long_factor:int ->
?max_gen:int ->
?max_fail:int ->
?small:('a -> int) ->
?retries:int ->
?name:string ->
'a arbitrary ->
('a -> bool) ->
t
make arb prop
builds a test that checks property prop
on instances of the generator arb
. See make_cell
for a description of the parameters.
val make_neg :
?if_assumptions_fail:([ `Fatal | `Warning ] * float) ->
?count:int ->
?long_factor:int ->
?max_gen:int ->
?max_fail:int ->
?small:('a -> int) ->
?retries:int ->
?name:string ->
'a arbitrary ->
('a -> bool) ->
t
make_neg arb prop
builds a test that checks property prop
on instances of the generator arb
. The test is considered negative, meaning that it is expected not to satisfy the tested property. This information is recorded in an underlying test cell
entry and interpreted suitably by test runners. See make_cell
for a description of the parameters.
include module type of QCheck2.Test_exceptions
Exception raised when a test failed, with the list of counter-examples. Test_fail (name, l)
means test name
failed on elements of l
.
Exception raised when a test raised an exception e
, with the sample that triggered the exception. Test_error (name, i, e, st)
means name
failed on i
with exception e
, and st
is the stacktrace (if enabled) or an empty string.
val print_instance : 'a cell -> 'a -> string
val print_c_ex : 'a cell -> 'a TestResult.counter_ex -> string
val print_fail : 'a cell -> string -> 'a TestResult.counter_ex list -> string
val print_error :
?st:string ->
'a cell ->
string ->
('a TestResult.counter_ex * exn) ->
string
val check_cell :
?long:bool ->
?call:'a callback ->
?step:'a step ->
?handler:'a handler ->
?rand:Stdlib.Random.State.t ->
'a cell ->
'a TestResult.t
val check_exn : ?long:bool -> ?rand:Stdlib.Random.State.t -> t -> unit