package b0

  1. Overview
  2. Docs
Software construction and deployment kit

Install

dune-project
 Dependency

Authors

Maintainers

Sources

b0-0.0.6.tbz
sha512=e9aa779e66c08fc763019f16d4706f465d16c05d6400b58fbd0313317ef33ddea51952e2b058db28e65f7ddb7012f328c8bf02d8f1da17bb543348541a2587f0

doc/b0.std/B0_testing/Test/Snapshot/index.html

Module Test.SnapshotSource

Snapshot tests.

Snaphots

Sourcetype 'a t = loc * 'a

The type for expected snapshots of type 'a.

Warning. Do not rely on this being a structural type use loc and value to deconstruct it.

Sourceval loc : 'a t -> loc

loc s is the location of the expected snapshot.

Sourceval value : 'a t -> 'a

value s is the value of the expected snapshot.

Substitutions

Sourcetype 'a subst = 'a T.t -> 'a t -> by:'a -> src:string -> Patch.subst

The type for snapshot substitution functions, returns a substitution to perform in src. Raise Failure if you can't.

Sourceval generic_subst : 'a subst

generic_subst is a generic snapshot substution function. It uses the given tester's pretty printer to print the new snapshot which must result in valid OCaml syntax.

Sourceval string_subst : string subst

string_subst is a special snapshot substitution function for string literals. It looks in the context to preserve quoted literal strings.

Test run state

Sourceval correct : unit -> bool

correct () is true if expected snapshot mismatches must be updated to the snapshot computed during the run.

Sourceval force_correct : unit -> bool

force_correct () is true if all expected snapshots must be be updated to the snapshots computed during the run, regardless of their correctness.