package qcheck-core

  1. Overview
  2. Docs

Result of running a test

type 'a counter_ex = {
  1. instance : 'a;
    (*

    The counter-example(s)

    *)
  2. shrink_steps : int;
    (*

    How many shrinking steps for this counterex

    *)
  3. msg_l : string list;
    (*

    messages.

    • since 0.7
    *)
}
type 'a failed_state = 'a counter_ex list
type 'a state =
  1. | Success
  2. | Failed of {
    1. instances : 'a failed_state;
      (*

      Failed instance(s)

      *)
    }
  3. | Failed_other of {
    1. msg : string;
    }
  4. | Error of {
    1. instance : 'a counter_ex;
    2. exn : exn;
    3. backtrace : string;
    }
    (*

    Error, backtrace, and instance that triggered it

    *)

Result state. changed in 0.10 (move to inline records, add Fail_other)

type 'a t = private {
  1. mutable state : 'a state;
  2. mutable count : int;
  3. mutable count_gen : int;
  4. collect_tbl : (string, int) Hashtbl.t lazy_t;
  5. stats_tbl : ('a stat * (int, int) Hashtbl.t) list;
    (*
    • since 0.6
    *)
  6. mutable warnings : string list;
  7. mutable instances : 'a list;
    (*

    List of instances used for this test, in no particular order.

    • since 0.9
    *)
}
val collect : _ t -> (string, int) Hashtbl.t option

Obtain statistics

  • since 0.6
val stats : 'a t -> ('a stat * (int, int) Hashtbl.t) list

Obtain statistics

  • since 0.6
val warnings : _ t -> string list

Obtain list of warnings

  • since 0.10
val is_success : _ t -> bool

Returns true iff the state if Success

  • since 0.9
OCaml

Innovation. Community. Security.