Index of values

(--) [QCheck.Gen]

Synonym to QCheck.Gen.int_range.

(--) [QCheck]

Synonym to QCheck.int_range.

(--.) [QCheck.Gen]

Synonym for float_range

(<*>) [QCheck.Iter]
(<*>) [QCheck.Gen]

Infix operator for composing a function generator and an argument generator into a result generator.

(<+>) [QCheck.Iter]

Synonym to QCheck.Iter.append.

(==>) [QCheck]

b1 ==> b2 is the logical implication b1 => b2 ie not b1 || b2 (except that it is strict and will interact better with QCheck.Test.check_exn and the likes, because they will know the precondition was not satisfied.).

(>:::) [QCheck_ounit]

Same as OUnit.>::: but with a list of QCheck tests

(>>=) [QCheck.Iter]
(>>=) [QCheck.Gen]

Monadic bind for writing dependent generators.

(>|=) [QCheck.Iter]
(>|=) [QCheck.Gen]

An infix synonym for QCheck.Gen.map.

(@->) [QCheck.Tuple.Infix]

Alias to B_cons.

(@::) [QCheck.Tuple.Infix]

Alias to QCheck.Tuple.cons.

A
add_shrink_invariant [QCheck]

Update shrinker by only keeping smaller values satisfying the given invariant.

add_stat [QCheck]

Add a statistic to the arbitrary instance.

always [QCheck]

Always return the same element.

append [QCheck.Iter]
append_l [QCheck.Iter]
apply [QCheck.Fn]
array [QCheck.Observable]
array [QCheck.Shrink]

Shrink an array.

array [QCheck.Print]

Array printer.

array [QCheck.Gen]

Builds an array generator from an element generator.

array [QCheck]

Generates arrays with length generated by small_nat.

array_of_size [QCheck]

Generates arrays with length from the given distribution.

array_repeat [QCheck.Gen]

array_repeat i g builds an array generator from exactly i elements generated by g.

array_size [QCheck.Gen]

Builds an array generator from a (non-negative) size generator and an element generator.

assume [QCheck]

assume cond checks the precondition cond, and does nothing if cond=true.

assume_fail [QCheck]

assume_fail () is like assume false, but can take any type since we know it always fails (like assert false).

B
big_nat [QCheck.Gen]

Generates natural numbers, possibly large.

bool [QCheck.Observable]
bool [QCheck.Print]

Boolean printer.

bool [QCheck.Gen]

The boolean generator.

bool [QCheck]

Uniform boolean generator.

C
callback [QCheck_base_runner.Raw]
char [QCheck.Observable]
char [QCheck.Shrink]
char [QCheck.Print]

Character printer.

char [QCheck.Gen]

Generates characters upto character code 255.

char [QCheck]

Uniformly distributed on all the chars (not just ascii or valid latin-1).

check_cell [QCheck.Test]

check_cell ~long ~rand test generates up to count random values of type 'a using arbitrary and the random state st.

check_cell_exn [QCheck.Test]

Same as QCheck.Test.check_cell but calls QCheck.Test.check_result on the result.

check_exn [QCheck.Test]

Checks the property against some test cases, and calls QCheck.Test.check_result, which might raise an exception in case of failure.

check_result [QCheck.Test]

check_result cell res checks that res is Ok _, and returns unit.

choose [QCheck]

Choose among the given list of generators.

collect [QCheck.TestResult]

Obtain statistics

comap [QCheck.Print]

comap f p maps p, a printer of type 'b, to a printer of type 'a by first converting a printed value using f : 'a -> 'b.

cons [QCheck.Tuple]
E
empty [QCheck.Iter]
equal [QCheck.Observable]
F
fail_report [QCheck.Test]

Fail the test with some additional message that will be reported.

fail_reportf [QCheck.Test]

Format version of QCheck.Test.fail_report

filter [QCheck.Shrink]

filter f shrink shrinks values the same as shrink, but only keep smaller values that satisfy f.

filter [QCheck.Iter]
find [QCheck.Iter]
find_example [QCheck]

find_example ~f gen uses gen to generate some values of type 'a, and checks them against f.

find_example_gen [QCheck]

Toplevel version of QCheck.find_example.

fix [QCheck.Gen]

Parametrized fixpoint combinator for generating recursive values.

flatten [QCheck.Iter]
float [QCheck.Observable]
float [QCheck.Print]

Floating point number printer.

float [QCheck.Gen]

Generates floating point numbers.

float [QCheck]

Generates regular floats (no nan and no infinities).

float_bound_exclusive [QCheck.Gen]

float_bound_exclusive bound returns a random floating-point number between 0 and bound (exclusive).

float_bound_exclusive [QCheck]

float_bound_exclusive n is uniform between 0 included and n excluded.

float_bound_inclusive [QCheck.Gen]

float_bound_inclusive bound returns a random floating-point number between 0 and bound (inclusive).

float_bound_inclusive [QCheck]

float_bound_inclusive n is uniform between 0 and n included.

float_range [QCheck.Gen]

float_range low high generates floating-point numbers within low and high (inclusive)

float_range [QCheck]

float_range low high is uniform between low included and high included.

frequency [QCheck.Gen]

Constructs a generator that selects among a given list of generators.

frequency [QCheck]

Similar to QCheck.oneof but with frequencies.

frequencya [QCheck.Gen]

Constructs a generator that selects among a given array of values.

frequencya [QCheck]

Same as QCheck.frequencyl, but with an array.

frequencyl [QCheck.Gen]

Constructs a generator that selects among a given list of values.

frequencyl [QCheck]

Same as QCheck.oneofl, but each element is paired with its frequency in the probability distribution (the higher, the more likely).

fun1 [QCheck]

fun1 o ret makes random functions that take an argument observable via o and map to random values generated from ret.

fun1_unsafe [QCheck]

Generator of functions of arity 1.

fun2 [QCheck]
fun2_unsafe [QCheck]

Generator of functions of arity 2.

fun3 [QCheck]
fun4 [QCheck]
fun_nary [QCheck]

fun_nary makes random n-ary functions.

G
gen [QCheck]

Access the underlying random generator of this arbitrary object.

generate [QCheck.Gen]

generate ~n g generates n instances of g.

generate1 [QCheck.Gen]

generate1 g generates one instance of g.

get_arbitrary [QCheck.Test]
get_count [QCheck.Test]

Get the count of a cell.

get_law [QCheck.Test]
get_long_factor [QCheck.Test]

Get the long factor of a cell.

get_name [QCheck.Test]
get_time_between_msg [QCheck_base_runner]

Get the minimum time to wait between printing messages.

graft_corners [QCheck.Gen]

graft_corners gen l () makes a new generator that enumerates the corner cases in l and then behaves like g.

H
hash [QCheck.Observable]
I
int [QCheck.Observable]
int [QCheck.Shrink]
int [QCheck.Print]

Integer printer.

int [QCheck.Gen]

Generates integers uniformly.

int [QCheck]

Int generator.

int32 [QCheck]

Int32 generator.

int64 [QCheck]

Int64 generator.

int_aggressive [QCheck.Shrink]

Shrink integers by trying all smaller integers (can take a lot of time!)

int_bound [QCheck.Gen]

Uniform integer generator producing integers within 0... bound.

int_bound [QCheck]

int_bound n is uniform between 0 and n included.

int_corners [QCheck.Gen]

All corner cases for int.

int_pos_corners [QCheck.Gen]

Non-negative corner cases for int.

int_range [QCheck.Gen]

Uniform integer generator producing integers within low,high.

int_range [QCheck]

int_range a b is uniform between a and b included.

is_success [QCheck.TestResult]

Returns true iff the state if Success

J
join [QCheck.Gen]

Collapses a generator of generators to simply a generator.

L
list [QCheck.Observable]
list [QCheck.Shrink]

Try to shrink lists by removing one or more elements.

list [QCheck.Print]

List printer.

list [QCheck.Gen]

Builds a list generator from an element generator.

list [QCheck]

Generates lists with length generated by small_nat.

list_elems [QCheck.Shrink]

Shrinks the elements of a list, without changing the list size.

list_of_size [QCheck]

Generates lists with length from the given distribution.

list_repeat [QCheck.Gen]

list_repeat i g builds a list generator from exactly i elements generated by g.

list_size [QCheck.Gen]

Builds a list generator from a (non-negative) size generator and an element generator.

list_spine [QCheck.Shrink]

Try to shrink lists by removing one or more elements.

long_tests [QCheck_base_runner]

Is the default mode to run long tests or nor?

M
make [QCheck.Test]

make arb prop builds a test that checks property prop on instances of the generator arb.

make [QCheck.Observable]
make [QCheck]

Builder for arbitrary.

make_cell [QCheck.Test]

make_cell arb prop builds a test that checks property prop on instances of the generator arb.

map [QCheck.Observable]
map [QCheck.Iter]
map [QCheck.Gen]

map f g transforms a generator g by applying f to each generated element.

map [QCheck]

map f a returns a new arbitrary instance that generates values using a#gen and then transforms them through f.

map2 [QCheck.Iter]
map2 [QCheck.Gen]

map2 f g1 g2 transforms two generators g1 and g2 by applying f to each pair of generated elements.

map3 [QCheck.Gen]

map3 f g1 g2 g3 transforms three generators g1, g2, and g3 by applying f to each triple of generated elements.

map_keep_input [QCheck.Gen]

map_keep_input f g transforms a generator g by applying f to each generated element.

map_keep_input [QCheck]

map_keep_input f a generates random values from a, and maps them into values of type 'b using the function f, but it also keeps the original value.

map_same_type [QCheck]

Specialization of map when the transformation preserves the type, which makes shrinker, printer, etc.

N
nat [QCheck.Gen]

Generates small natural numbers.

neg_float [QCheck]

Negative float generator (no nan and no infinities).

neg_int [QCheck.Gen]

Generates non-strictly negative integers (0 included).

neg_int [QCheck]

Negative int generator (0 included, see QCheck.Gen.neg_int).

nfloat [QCheck.Gen]

Generates negative floating point numbers.

nil [QCheck.Tuple]
nil [QCheck.Shrink]

No shrink

numeral [QCheck.Gen]

Generates numeral characters.

numeral_char [QCheck]

Uniformly distributed over '0'..'9'.

numeral_string [QCheck]

Generates strings with a distribution of length of small_nat and distribution of characters of numeral_char.

numeral_string_of_size [QCheck]

Generates strings with a distribution of characters of numeral_char.

O
o_cons [QCheck.Tuple]
o_nil [QCheck.Tuple]
observable [QCheck.Tuple]
of_array [QCheck.Iter]
of_list [QCheck.Iter]
oneof [QCheck.Gen]

Constructs a generator that selects among a given list of generators.

oneof [QCheck]

Pick a generator among the list, randomly.

oneofa [QCheck.Gen]

Constructs a generator that selects among a given array of values.

oneofa [QCheck]

Pick an element randomly in the array.

oneofl [QCheck.Gen]

Constructs a generator that selects among a given list of values.

oneofl [QCheck]

Pick an element randomly in the list.

opt [QCheck.Gen]

An option generator.

option [QCheck.Observable]
option [QCheck.Shrink]
option [QCheck.Print]

Option printer.

option [QCheck]

Choose between returning Some random value, or None.

P
pair [QCheck.Observable]
pair [QCheck.Shrink]

pair a b uses a to shrink the first element of tuples, then tries to shrink the second element using b.

pair [QCheck.Iter]
pair [QCheck.Print]

Pair printer.

pair [QCheck.Gen]

Generates pairs.

pair [QCheck]

Combines two generators into a generator of pairs.

parse_cli [QCheck_base_runner.Raw]
pfloat [QCheck.Gen]

Generates positive floating point numbers (0.

pint [QCheck.Gen]

Generates non-strictly positive integers uniformly (0 included).

pos_float [QCheck]

Positive float generator (no nan and no infinities).

pos_int [QCheck]

Positive int generator (0 included).

pp_str_c [QCheck_base_runner.Color]
print [QCheck.Fn]
print [QCheck.Observable]
print_c_ex [QCheck.Test]
print_collect [QCheck.Test]

Print "collect" results.

print_error [QCheck.Test]
print_fail [QCheck.Test]
print_fail_other [QCheck.Test]
print_instance [QCheck.Test]
print_stat [QCheck.Test]

Print statistics.

print_std [QCheck_base_runner.Raw]
print_test_error [QCheck.Test]
print_test_fail [QCheck.Test]
printable [QCheck.Gen]

Generates printable characters.

printable_char [QCheck]

Uniformly distributed over a subset of chars.

printable_string [QCheck]

Generates strings with a distribution of length of small_nat and distribution of characters of printable_char.

printable_string_of_size [QCheck]

Generates strings with distribution of characters of printable_char.

pure [QCheck.Gen]

Synonym for QCheck.Gen.return

Q
quad [QCheck.Observable]
quad [QCheck.Shrink]

Similar to QCheck.Shrink.pair

quad [QCheck.Iter]
quad [QCheck.Print]

Quadruple (4-tuple) printer.

quad [QCheck.Gen]

Generates quadruples.

quad [QCheck]

Combines four generators into a generator of 4-tuples.

R
random_state [QCheck_base_runner]

Access the current random state

reset_line [QCheck_base_runner.Color]
return [QCheck.Iter]
return [QCheck.Gen]

Create a constant generator.

run [QCheck_ounit]

run test runs the test, and returns an error code that is 0 if all tests passed, 1 otherwise.

run_tap [QCheck_ounit]

TAP-compatible test runner, in case we want to use a test harness.

run_tests [QCheck_base_runner]

Run a suite of tests, and print its results.

run_tests_main [QCheck_base_runner]

Can be used as the main function of a test file.

S
set_collect [QCheck]
set_gen [QCheck]

Change the generator

set_long_tests [QCheck_base_runner]

Change the value of long_tests ()

set_name [QCheck.Test]
set_print [QCheck]
set_seed [QCheck_base_runner]

Change the QCheck_base_runner.random_state by creating a new one, initialized with the given seed.

set_shrink [QCheck]
set_small [QCheck]
set_stats [QCheck]
set_time_between_msg [QCheck_base_runner]

Set the minimum tiem between messages.

set_verbose [QCheck_base_runner]

Change the value of verbose ()

shrink [QCheck.Fn]
shuffle_a [QCheck.Gen]

Shuffles the array in place.

shuffle_l [QCheck.Gen]

Creates a generator of shuffled lists.

shuffle_w_l [QCheck.Gen]

Creates a generator of weighted shuffled lists.

sized [QCheck.Gen]

Creates a generator from a size-bounded generator by first generating a size using QCheck.Gen.nat and passing the result to the size-bounded generator.

sized_size [QCheck.Gen]

Creates a generator from a size-bounded generator by first generating a size using the integer generator and passing the result to the size-bounded generator.

small_array [QCheck.Gen]

Generates arrays of small size (see QCheck.Gen.small_nat).

small_int [QCheck.Gen]

Small UNSIGNED integers, for retrocompatibility.

small_int [QCheck]

Small unsigned integers.

small_int_corners [QCheck]

As small_int, but each newly created generator starts with a list of corner cases before falling back on random generation.

small_list [QCheck.Gen]

Generates lists of small size (see QCheck.Gen.small_nat).

small_list [QCheck]

Generates lists of small size (see QCheck.Gen.small_nat).

small_nat [QCheck.Gen]

Small integers (< 100)

small_nat [QCheck]

Small unsigned integers.

small_printable_string [QCheck]
small_signed_int [QCheck.Gen]

Small SIGNED integers, based on QCheck.Gen.small_nat.

small_signed_int [QCheck]

Small signed integers.

small_string [QCheck.Gen]

Builds a string generator, length is QCheck.Gen.small_nat Accepts an optional character generator (the default is QCheck.Gen.char).

small_string [QCheck]

Same as QCheck.string but with a small length (ie QCheck.Gen.small_nat ).

stats [QCheck.TestResult]

Obtain statistics

string [QCheck.Observable]
string [QCheck.Shrink]
string [QCheck.Print]

String printer.

string [QCheck.Gen]

Builds a string generator.

string [QCheck]

Generates strings with a distribution of length of small_nat and distribution of characters of char.

string_gen [QCheck]

Generates strings with a distribution of length of small_nat.

string_gen_of_size [QCheck]
string_of [QCheck.Gen]

Builds a string generator using the given character generator.

string_of_size [QCheck]

Generates strings with distribution of characters if char.

string_readable [QCheck.Gen]

Builds a string generator using the QCheck.Gen.char character generator.

string_size [QCheck.Gen]

Builds a string generator from a (non-negative) size generator.

T
to_ounit2_test [QCheck_ounit]

to_ounit2_test ?rand t wraps t into a OUnit2 test

to_ounit2_test_list [QCheck_ounit]

to_ounit2_test_list ?rand t like to_ounit2_test but for a list of tests

to_ounit_test [QCheck_ounit]

to_ounit_test ~rand t wraps t into a OUnit test

to_ounit_test_cell [QCheck_ounit]

Same as QCheck_ounit.to_ounit_test but with a polymorphic test cell

triple [QCheck.Observable]
triple [QCheck.Shrink]

Similar to QCheck.Shrink.pair

triple [QCheck.Iter]
triple [QCheck.Print]

Triple (3-tuple) printer.

triple [QCheck.Gen]

Generates triples.

triple [QCheck]

Combines three generators into a generator of 3-tuples.

U
ui32 [QCheck.Gen]

Generates (unsigned) int32 values.

ui64 [QCheck.Gen]

Generates (unsigned) int64 values.

unit [QCheck.Observable]
unit [QCheck.Shrink]
unit [QCheck.Print]
unit [QCheck.Gen]

The unit generator.

unit [QCheck]

Always generates (), obviously.

V
verbose [QCheck_base_runner]

Is the default mode verbose or quiet?

W
warnings [QCheck.TestResult]

Obtain list of warnings