Module Webtest.Suite

module Suite: sig .. end
Types and functions for creating and structuring unit test suites.

exception TestFailure of string
The exception thrown by failing tests.
type result = 
| Error of exn (*
An unexpected error occurred in the test.
*)
| Fail of string (*
An assertion failed in the test.
*)
| Pass (*
The test passed.
*)
The result of running a single testcase.
type outcome = {
   label : string;
   result : result;
   time_s : float;
}
The outcome of a test: its label, result, and time taken to run.
val string_of_result : result -> string
module Sync: sig .. end
module Async: sig .. end
type t = 
| TestCase of string * Async.test_fun (*
A labelled single test.
*)
| TestList of string * t list (*
A labelled list of tests.
*)
A labelled wrapper around a test or list of suites.
val (>::) : string -> Sync.test_fun -> t
Convenience function to create a suite from a label and a Sync.test_fun.
val (>:~) : string -> Async.test_fun -> t
Convenience function to create a suite from a label and an Async.test_fun.
val (>:::) : string -> t list -> t
Convenience function to create a suite from a label and a list of suites.
val assert_true : ?label:string -> bool -> unit
assert_bool label value returns unit if value is true, and otherwise raises TestFailure.
val assert_equal : ?equal:('a -> 'a -> bool) ->
?label:string -> ?printer:('a -> string) -> 'a -> 'a -> unit
assert_equal a b returns unit if a is equal to b, and otherwise raises TestFailure.
val assert_raises : ?label:string -> exn -> (unit -> unit) -> unit
assert_raises e task returns unit if task () raises e, and otherwise raises TestFailure.
val assert_raises_string : ?label:string -> string -> (unit -> unit) -> unit
assert_raises_string str task returns unit if task () raises an exception e for which Printexc.to_string e = str, and otherwise raises TestFailure.