package ppx_expect

  1. Overview
  2. Docs
val f : ?use_dot_patdiff:Base.bool -> ?corrected_path:Base.string -> ?use_color:Base.bool -> ?diff_command:Base.string -> ?diff_path_prefix:Base.string -> next_contents:Base.string -> path:Base.string -> Base.unit -> Base.unit Base.Or_error.t

f ~next_contents ~path () compares the contents of path against next_contents. If the contents are unchanged, f returns Ok (). If they are changed, it writes next_contents to corrected_path, emits a build error, and returns Error _. The caller should exit nonzero (possibly by raising the returned error) to indicate to the build that an error occurred. If it doesn't, the build system may not recognize that a corrected file has been generated and needs to be moved out of a sandbox.

The optional arguments support "expert" use cases. Most clients do not need them.

OCaml

Innovation. Community. Security.