fake

package
v1.0.5 Latest Latest
Warning

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

Go to latest
Published: Aug 22, 2026 License: MIT Imports: 4 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

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