runner

package
v1.2.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 21, 2026 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CheckResult

type CheckResult struct {
	Name      string   `json:"name"`
	Kind      string   `json:"kind"` // "scenario" or "invariant"
	Passed    bool     `json:"passed"`
	InputsRun int      `json:"inputs_run"`          // 1 for given-scenarios, N for when/invariants
	FailedAt  int      `json:"failed_at,omitempty"` // which input number failed (0 if passed)
	Failure   *Failure `json:"failure,omitempty"`
}

CheckResult captures the outcome of a single scenario or invariant.

type Failure

type Failure struct {
	Name        string `json:"name"`
	Scope       string `json:"scope"`
	Input       any    `json:"input,omitempty"`
	Expected    any    `json:"expected,omitempty"`
	Actual      any    `json:"actual,omitempty"`
	Description string `json:"description"`
	Shrunk      bool   `json:"shrunk"`
}

type Result

type Result struct {
	Spec              string        `json:"spec"`
	Scopes            []ScopeResult `json:"scopes"`
	Failures          []Failure     `json:"failures"`
	ScenariosRun      int           `json:"scenarios_run"`
	ScenariosPassed   int           `json:"scenarios_passed"`
	InvariantsChecked int           `json:"invariants_checked"`
	InvariantsPassed  int           `json:"invariants_passed"`
}

Result captures the outcome of a verification run.

type Runner

type Runner struct {
	// contains filtered or unexported fields
}

Runner orchestrates spec verification.

func New

func New(spec *parser.Spec, adp adapter.Adapter, seed uint64) *Runner

New creates a runner for the given spec.

func (*Runner) SetN

func (r *Runner) SetN(n int)

SetN configures how many inputs to generate per when-scenario and invariant.

func (*Runner) Verify

func (r *Runner) Verify() (*Result, error)

Verify runs all scopes' scenarios and invariants, returning results.

type ScopeResult

type ScopeResult struct {
	Name   string        `json:"name"`
	Checks []CheckResult `json:"checks"`
}

ScopeResult captures per-scope verification results.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL