Library
Module
Module type
Parameter
Class
Class type
Library to handle cram tests format.
type line = [
| output
| `Command of string list
| `Comment of string
| `Part of string
| `Non_det of [ `Output | `Command ]
| `Exit of int
]
The type for all lines.
val pp_command : string list Fmt.t
pp_command
display a multi-line command.
pp_line
is the pretty-printer for lines. If hide
is true, commands starting by @@
are not displayed. By default, hide
is not set (all the lines are printed).
type test = {
part : string option;
non_deterministic : [ `Command | `Output | `False ];
command : string list;
output : output list;
lines : line list;
exit_code : int;
}
The type for tests.
type t = item list
The type for cram files.
val to_string : ?hide:bool -> t -> string
val parse_file : string -> t
val parse_lexbuf : Lexing.lexbuf -> t
val run : string -> f:(string -> t -> string) -> unit
run n f
runs the expect callback f
over the file named n
. f
is called with the raw contents of n
and its structured contents; it returns the new file contents. If the result of f
is different from the initial contents, then $n.corrected
is created with the new contents.
val pp_exit_code : int Fmt.t
Display exit code.
equal x y
compares x
and y
; Ellipsis
are used as wildcards for zero, one or multiple matching lines.
val to_html : t -> string