package qcheck

  1. Overview
  2. Docs
Legend:
Library
Module
Module type
Parameter
Class
Class type
type 'a t = 'a -> bool
val (==>) : ('a -> bool) -> 'a t -> 'a t

Precondition for a test

val assume : bool -> unit

Assume the given precondition holds. A test won't fail if the precondition (the boolean argument) is false, but it will be discarded. Running tests counts how many instances were discarded for not satisfying preconditions.

val assume_lazy : bool lazy_t -> unit

Assume the given (lazy) precondition holds. See assume.

val raises : e:exn -> f:('a -> 'b) -> x:'a -> bool

raise ~e ~f ~x is true if and only if calling f x raises the exception exn.

For instance (on lists): let prop l = Prop.(assume (l = []); raises ~f:List.hd ~x:l ~e:(Failure "hd"));;

val (&&&) : 'a t -> 'a t -> 'a t

Logical 'and' on tests

val (|||) : 'a t -> 'a t -> 'a t

Logical 'or' on tests

val (!!!) : 'a t -> 'a t

Logical 'not' on tests

OCaml

Innovation. Community. Security.