Module Core_kernel.Quickcheck
include Quickcheck_intf.Quickcheck
- type nonrec seed- = Quickcheck_intf.seed
- type nonrec shrink_attempts- = Quickcheck_intf.shrink_attempts
module Generator : Quickcheck_intf.Generatormodule Observer : Quickcheck_intf.Observermodule Shrinker : Quickcheck_intf.Shrinkermodule type S = Quickcheck_intf.Smodule type S1 = Quickcheck_intf.S1module type S2 = Quickcheck_intf.S2module type S_int = Quickcheck_intf.S_intmodule Let_syntax : module type of Generator.Let_syntax with module Let_syntax.Let_syntax.Open_on_rhs = Generatormodule type Quickcheck_config = Quickcheck_intf.Quickcheck_configmodule type Quickcheck_configured = Quickcheck_intf.Quickcheck_configuredwith a default config
include Quickcheck_configured
include Quickcheck_intf.Quickcheck_config
- val default_seed : Quickcheck_intf.seed
- default_seedis used initialize the pseudo-random generator that chooses random values from generators, in each test that is not provided its own seed.
- val default_sizes : Core_kernel__.Import.int Sequence.t
- default_sizesdetermines the default sequence of sizes used in generating values.
- val default_trial_count : Core_kernel__.Import.int
- default_trial_countdetermines the number of trials per test, except in tests that explicitly override it.
- val default_can_generate_trial_count : Core_kernel__.Import.int
- default_can_generate_trial_countdetermines the number of trials used in attempts to generate satisfying values, except in tests that explicitly override it.
- val default_shrink_attempts : Quickcheck_intf.shrink_attempts
- default_shrink_attemptsdetermines the number of attempts at shrinking when running- testor- iterwith- ~shrinkerand without- ~shrink_attempts
- val random_value : ?seed:Quickcheck_intf.seed -> ?size:Core_kernel__.Import.int -> 'a Base_quickcheck.Generator.t -> 'a
- random_value genproduces a single value chosen from- genusing- seed.
- val iter : ?seed:Quickcheck_intf.seed -> ?sizes:Core_kernel__.Import.int Sequence.t -> ?trials:Core_kernel__.Import.int -> 'a Base_quickcheck.Generator.t -> f:('a -> Core_kernel__.Import.unit) -> Core_kernel__.Import.unit
- iter gen ~fruns- fon up to- trialsdifferent values generated by- gen. It stops successfully after- trialssuccessful trials or if- genruns out of values. It raises an exception if- fraises an exception.
- val test : ?seed:Quickcheck_intf.seed -> ?sizes:Core_kernel__.Import.int Sequence.t -> ?trials:Core_kernel__.Import.int -> ?shrinker:'a Base_quickcheck.Shrinker.t -> ?shrink_attempts:Quickcheck_intf.shrink_attempts -> ?sexp_of:('a -> Base.Sexp.t) -> ?examples:'a Core_kernel__.Import.list -> 'a Base_quickcheck.Generator.t -> f:('a -> Core_kernel__.Import.unit) -> Core_kernel__.Import.unit
- test gen ~fis like- iter, with optional concrete- examplesthat are tested before values from- gen, and additional information provided on failure. If- fraises an exception and- sexp_ofis provided, the exception is re-raised with a description of the random input that triggered the failure. If- fraises an exception and- shrinkeris provided, it will be used to attempt to shrink the value that caused the exception with re-raising behaving the same as for unshrunk inputs.
- val test_or_error : ?seed:Quickcheck_intf.seed -> ?sizes:Core_kernel__.Import.int Sequence.t -> ?trials:Core_kernel__.Import.int -> ?shrinker:'a Base_quickcheck.Shrinker.t -> ?shrink_attempts:Quickcheck_intf.shrink_attempts -> ?sexp_of:('a -> Base.Sexp.t) -> ?examples:'a Core_kernel__.Import.list -> 'a Base_quickcheck.Generator.t -> f:('a -> Core_kernel__.Import.unit Or_error.t) -> Core_kernel__.Import.unit Or_error.t
- test_or_erroris like- test, except failure is determined using- Or_error.t. Any exceptions raised by- fare also treated as failures.
- val test_can_generate : ?seed:Quickcheck_intf.seed -> ?sizes:Core_kernel__.Import.int Sequence.t -> ?trials:Core_kernel__.Import.int -> ?sexp_of:('a -> Base.Sexp.t) -> 'a Base_quickcheck.Generator.t -> f:('a -> Core_kernel__.Import.bool) -> Core_kernel__.Import.unit
- test_can_generate gen ~fis useful for testing- genvalues, to make sure they can generate useful examples. It tests- genby generating up to- trialsvalues and passing them to- f. Once a value satisfies- f, the iteration stops. If no values satisfy- f,- test_can_generateraises an exception. If- sexp_ofis provided, the exception includes all of the generated values.
- val test_distinct_values : ?seed:Quickcheck_intf.seed -> ?sizes:Core_kernel__.Import.int Sequence.t -> ?sexp_of:('a -> Base.Sexp.t) -> 'a Base_quickcheck.Generator.t -> trials:Core_kernel__.Import.int -> distinct_values:Core_kernel__.Import.int -> compare:('a -> 'a -> Core_kernel__.Import.int) -> Core_kernel__.Import.unit
- test_distinct_values genis useful for testing- genvalues, to make sure they create sufficient distinct values. It tests- genby generating up to- trialsvalues and making sure at least- distinct_valuesof the resulting values are unique with respect to- compare. If too few distinct values are generated,- test_distinct_valuesraises an exception. If- sexp_ofis provided, the exception includes the values generated.
- val random_sequence : ?seed:Quickcheck_intf.seed -> ?sizes:Core_kernel__.Import.int Sequence.t -> 'a Base_quickcheck.Generator.t -> 'a Sequence.t
- random_sequence ~seed genproduces a sequence of values chosen from- gen.
module Configure : functor (Config : Quickcheck_config) -> Quickcheck_configured