exectest

package
v1.12.0 Latest Latest
Warning

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

Go to latest
Published: Apr 17, 2026 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func EchoCommand

func EchoCommand(output string) func(context.Context, string, ...string) *exec.Cmd

EchoCommand returns a command factory that echoes the given output.

func FailCommand

func FailCommand() func(context.Context, string, ...string) *exec.Cmd

FailCommand returns a command factory that always exits non-zero.

func FakeExecutable

func FakeExecutable(path string) func() (string, error)

FakeExecutable returns an osExecutable function that always returns the given path.

func FakeLookPath

func FakeLookPath(path string) func(string) (string, error)

FakeLookPath returns a lookup function that always succeeds with the given path.

func MissingLookPath

func MissingLookPath() func(string) (string, error)

MissingLookPath returns a lookup function that always fails with "not found".

func NoopCommand

func NoopCommand() func(context.Context, string, ...string) *exec.Cmd

NoopCommand returns a command factory that produces a no-op process.

func TrackingCommand

func TrackingCommand(log *[]string) func(context.Context, string, ...string) *exec.Cmd

TrackingCommand returns a command factory that records each invocation (name + args) into the provided slice and returns a no-op process.

Types

This section is empty.

Jump to

Keyboard shortcuts

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