package mdx

  1. Overview
  2. Docs

Module Mdx.CramSource

Cram tests

Sourcetype t = {
  1. command : string list;
  2. output : Output.t list;
  3. exit_code : int;
}
Sourcetype cram_tests = {
  1. start_pad : int;
  2. hpad : int;
  3. tests : t list;
  4. end_pad : string option;
}

The type for cram tests.

Accessors

Sourceval exit_code : t -> int

exit_code t is t's exit code.

Sourceval use_heredoc : t -> bool

use_heredoc t is true iff t uses the heredoc '<<' syntax.

Sourceval command_line : t -> string

command_line t is t's command line. It either adds '\' at the end of each line of t's command or do nothing is t uses the heredoc syntax.

Parser

Sourceval of_lines : string list -> cram_tests

of_lines l parses the commands l.

Pretty-printer

Sourceval pp : ?pad:int -> t Fmt.t

pp is the pretty-printer for cram tests. pad is the size of the optional whitespace left padding (by default it is 0).

Sourceval pp_vertical_pad : int Fmt.t

pp_vertical_pad is the pretty printer for the initial padding on the top of Cram tests

Sourceval dump : t Fmt.t

dump it the printer for dumping cram tests. Useful for debugging.

Sourceval dump_cram_tests : cram_tests Fmt.t
Sourceval pp_command : ?pad:int -> t Fmt.t

pp_command pretty-prints cram commands.

Sourceval pp_exit_code : ?pad:int -> int Fmt.t

pp_exit_code pretty-prints exit code.

OCaml

Innovation. Community. Security.