Note that while check_exn is provided for convenience to discover QCheck or to run a single test in utop, to run QCheck tests in your project you probably want to opt for a more advanced runner, or convert QCheck tests to your favorite test framework:
QCheck_base_runner for a QCheck-only runner (useful if you don't have or don't need another test framework)
QCheck_alcotest to convert to Alcotest framework
QCheck_ounit to convert to OUnit framework
type'a cell
A single property test on a value of type 'a. A Test.t wraps a cell and hides its type parameter.
make_cell gen prop builds a test that checks property prop on instances of the generator gen.
parametername
the name of the test.
parametercount
number of test cases to run, counting only the test cases which satisfy preconditions.
parameterlong_factor
the factor by which to multiply count, max_gen and max_fail when running a long test (default: 1).
parametermax_gen
maximum number of times the generation function is called in total to replace inputs that do not satisfy preconditions (should be >= count).
parametermax_fail
maximum number of failures before we stop generating inputs. This is useful if shrinking takes too much time.
parameterif_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)
parameterprint
used in Print to display generated values failing the prop
parametercollect
(* collect values by tag, useful to display distribution of generated *)
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.
check_cell ~long ~rand test generates up to count random values of type 'a using Gen.t and the random state st. The predicate law is called on them and if it returns false or raises an exception then we have a counter-example for the law.
parameterlong
if true then multiply the number of instances to generate by the cell's long_factor.
parametercall
function called on each test case, with the result.
parameterstep
function called on each instance of the test case, with the result.