sig
module Suite :
sig
exception TestFailure of string
type result = Error of exn | Fail of string | Pass
type outcome = {
label : string;
result : Webtest.Suite.result;
time_s : float;
}
val string_of_result : Webtest.Suite.result -> string
module Sync :
sig
type test_fun = unit -> unit
val bracket :
(unit -> 'a) ->
('a -> unit) -> ('a -> unit) -> Webtest.Suite.Sync.test_fun
end
module Async :
sig
type callback = unit -> unit
val noop : Webtest.Suite.Async.callback
type wrapper = Webtest.Suite.Async.callback -> unit
type test_fun = Webtest.Suite.Async.wrapper -> unit
val bracket :
(unit -> 'a) ->
('a -> Webtest.Suite.Async.wrapper -> unit) ->
('a -> unit) -> Webtest.Suite.Async.test_fun
val run_one :
string ->
Webtest.Suite.Async.test_fun ->
(string -> unit) -> (Webtest.Suite.outcome -> unit) -> unit
val of_sync :
Webtest.Suite.Sync.test_fun -> Webtest.Suite.Async.test_fun
end
type t =
TestCase of string * Webtest.Suite.Async.test_fun
| TestList of string * Webtest.Suite.t list
val ( >:: ) : string -> Webtest.Suite.Sync.test_fun -> Webtest.Suite.t
val ( >:~ ) : string -> Webtest.Suite.Async.test_fun -> Webtest.Suite.t
val ( >::: ) : string -> Webtest.Suite.t list -> Webtest.Suite.t
val assert_true : ?label:string -> bool -> unit
val assert_equal :
?equal:('a -> 'a -> bool) ->
?label:string -> ?printer:('a -> string) -> 'a -> 'a -> unit
val assert_raises : ?label:string -> exn -> (unit -> unit) -> unit
val assert_raises_string :
?label:string -> string -> (unit -> unit) -> unit
end
module Zipper :
sig
type crumb = {
left : Webtest.Suite.t list;
label : string;
right : Webtest.Suite.t list;
}
type t = {
crumbs : Webtest.Zipper.crumb list;
location : Webtest.Suite.t;
}
val of_suite : Webtest.Suite.t -> Webtest.Zipper.t
val to_suite : Webtest.Zipper.t -> Webtest.Suite.t
val move_up : Webtest.Zipper.t -> Webtest.Zipper.t option
val move_down : Webtest.Zipper.t -> Webtest.Zipper.t option
val move_right : Webtest.Zipper.t -> Webtest.Zipper.t option
val next_location : Webtest.Zipper.t -> Webtest.Zipper.t option
val get_labels : Webtest.Zipper.t -> string list
end
module Utils :
sig
type output = {
log : string list;
outcomes : Webtest.Suite.outcome list;
}
type raw_summary = {
total : int;
errors : int;
failures : int;
passes : int;
passed : bool;
}
type summary = { report : string; passed : bool; }
val run : Webtest.Suite.t -> (Webtest.Utils.output -> unit) -> unit
val summarise_raw :
Webtest.Suite.outcome list -> Webtest.Utils.raw_summary
val summary_of_raw : Webtest.Utils.raw_summary -> Webtest.Utils.summary
val summarise : Webtest.Suite.outcome list -> Webtest.Utils.summary
end
end