fake

package
v0.12.0 Latest Latest
Warning

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

Go to latest
Published: Jul 22, 2026 License: MIT Imports: 4 Imported by: 0

Documentation

Overview

Package fake is an in-memory runtime.Runtime for fast, deterministic unit tests (backlog AO-014: "Interface is mockable — a FakeRuntime powers fast unit tests"). It spawns no processes.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Runtime

type Runtime struct {
	// ExitCode is the exit code reported for non-canceled runs (default 0).
	ExitCode int
	// Block, when true, holds the run open (after the started event) until it
	// is canceled or signaled — useful for exercising Signal/Cancel.
	Block bool
	// Stdout, when non-empty, is emitted as raw stdout lines (EventStdout) before
	// the terminal exited event — lets a test feed a canned provider stream (e.g.
	// claude's stream-json result line). Empty leaves behavior unchanged.
	Stdout []string
	// contains filtered or unexported fields
}

Runtime is a scriptable fake executor.

func New

func New() *Runtime

New returns a fake runtime.

func (*Runtime) Dispatch

func (r *Runtime) Dispatch(ctx context.Context, spec runtime.RunSpec) (runtime.Run, error)

Dispatch implements runtime.Runtime.

func (*Runtime) Dispatched

func (r *Runtime) Dispatched() []runtime.RunSpec

Dispatched returns the specs dispatched so far.

func (*Runtime) Name

func (r *Runtime) Name() string

Name implements runtime.Runtime.

func (*Runtime) Signals

func (r *Runtime) Signals(runID string) []string

Signals returns the inputs injected into a run via Signal.

Jump to

Keyboard shortcuts

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