Deterministic minimization helpers for generated failures.
shrink/2 takes a failing program and a predicate that returns true while a
candidate still reproduces the failure. It tries smaller generation options
and returns the smallest candidate it can find without losing the failure.
Summary
Functions
Attempts to minimize a failing generated program.
Attempts to minimize a failing generated program.
Types
@type predicate() :: (ProgramFacts.Program.t() -> boolean())
@type result() :: %{ program: ProgramFacts.Program.t(), options: keyword(), steps: [step()] }
Functions
@spec shrink(ProgramFacts.Program.t(), predicate()) :: result()
Attempts to minimize a failing generated program.
failure? must return true for the original program and for each accepted
candidate. The result contains the minimized program, its generation options,
and a trace of attempted shrink steps.
@spec shrink(ProgramFacts.Program.t(), predicate(), keyword()) :: result()
Attempts to minimize a failing generated program.
failure? must return true for the original program and for each accepted
candidate. The result contains the minimized program, its generation options,
and a trace of attempted shrink steps.