Module 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 res= QCheck2.Test.res=|Success|Failure|FalseAssumption|Error of exn * stringtype 'a event= 'a QCheck2.Test.event=|Generating|Collecting of 'a|Testing of 'a|Shrunk of int * 'a|Shrinking of int * int * 'atype 'a cell= 'a QCheck2.Test.celltype 'a handler= 'a QCheck2.Test.handlertype 'a step= 'a QCheck2.Test.steptype 'a callback= 'a QCheck2.Test.callbacktype t= QCheck2.Test.t
val fail_report : string -> 'aFail the test with some additional message that will be reported.
- since
- 0.7
val fail_reportf : ('a, Stdlib.Format.formatter, unit, 'b) Stdlib.format4 -> 'aFormat version of
fail_report- since
- 0.7
val make_cell : ?if_assumptions_fail:([ `Fatal | `Warning ] * float) -> ?count:int -> ?long_factor:int -> ?max_gen:int -> ?max_fail:int -> ?small:('a -> int) -> ?name:string -> 'a arbitrary -> ('a -> bool) -> 'a cellmake_cell arb propbuilds a test that checks propertypropon instances of the generatorarb.- parameter name
the name of the test.
- parameter count
number of test cases to run, counting only the test cases which satisfy preconditions.
- parameter long_factor
the factor by which to multiply count, max_gen and max_fail when running a long test (default: 1).
- parameter max_gen
maximum number of times the generation function is called in total to replace inputs that do not satisfy preconditions (should be >= count).
- parameter max_fail
maximum number of failures before we stop generating inputs. This is useful if shrinking takes too much time.
- parameter small
kept for compatibility reasons; if provided, replaces the field
arbitrary.small. If there is no shrinking function but there is asmallfunction, only the smallest failures will be printed.
- parameter if_assumptions_fail
the minimum fraction of tests that must satisfy the precondition for a success to be considered valid. The fraction should be between 0. and 1. A warning will be emitted otherwise if the flag is
`Warning, the test will be a failure if the flag is`Fatal. (since 0.10)
val get_law : 'a cell -> 'a -> bool- deprecated
use
QCheck2.Test.get_lawinstead
val get_name : _ cell -> string- deprecated
use
QCheck2.Test.get_lawinstead
- deprecated
use
QCheck2.Test.get_nameinstead
val set_name : _ cell -> string -> unit- deprecated
use
QCheck2.Test.get_nameinstead
- deprecated
use
QCheck2.Test.set_nameinstead
val get_count : _ cell -> intGet the count of a cell.
- deprecated
use
QCheck2.Test.get_countinstead
- since
- 0.5.3
val get_long_factor : _ cell -> intGet the long factor of a cell.
- deprecated
use
QCheck2.Test.get_long_factorinstead
- since
- 0.5.3
val make : ?if_assumptions_fail:([ `Fatal | `Warning ] * float) -> ?count:int -> ?long_factor:int -> ?max_gen:int -> ?max_fail:int -> ?small:('a -> int) -> ?name:string -> 'a arbitrary -> ('a -> bool) -> tmake arb propbuilds a test that checks propertypropon instances of the generatorarb. Seemake_cellfor a description of the parameters.
include module type of QCheck2.Test_exceptions
val print_instance : 'a cell -> 'a -> stringval print_c_ex : 'a cell -> 'a TestResult.counter_ex -> stringval print_fail : 'a cell -> string -> 'a TestResult.counter_ex list -> stringval print_fail_other : string -> msg:string -> stringval print_error : ?st:string -> 'a cell -> string -> ('a TestResult.counter_ex * exn) -> stringval print_test_fail : string -> string list -> stringval print_test_error : string -> string -> exn -> string -> stringval check_cell : ?long:bool -> ?call:'a callback -> ?step:'a step -> ?handler:'a handler -> ?rand:Stdlib.Random.State.t -> 'a cell -> 'a TestResult.tval check_cell_exn : ?long:bool -> ?call:'a callback -> ?step:'a step -> ?rand:Stdlib.Random.State.t -> 'a cell -> unitval check_exn : ?long:bool -> ?rand:Stdlib.Random.State.t -> t -> unit