Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Shrink ¶
func Shrink( input map[string]any, fields []*parser.Field, models map[string]*parser.Model, stillFails func(map[string]any) bool, ) map[string]any
Shrink attempts to find a minimal counterexample by shrinking each field in the input. The stillFails predicate re-executes against the real system to confirm the shrunk input still triggers the failure.
Types ¶
type Generator ¶
type Generator struct {
// contains filtered or unexported fields
}
Generator produces random valid inputs from a contract and model definitions.
func (*Generator) ContractInput ¶
ContractInput returns the contract's input fields for use by the shrinking engine.
func (*Generator) GenerateInput ¶
GenerateInput produces one random valid input satisfying the contract's constraints. It uses rejection sampling: generate unconstrained values, then check constraints, retrying until valid. For the typical transfer spec this converges quickly.
func (*Generator) GenerateMatching ¶
GenerateMatching generates an input satisfying both contract constraints and the given predicate. Uses rejection sampling.