bashref

package
v0.3.1 Latest Latest
Warning

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

Go to latest
Published: Oct 30, 2026 License: MIT Imports: 11 Imported by: 0 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 bashref gives the results of the bash implementation (0.2's agent-vm.sh and lib/), for tests that compare the Go code with it. They were recorded, before the bash version was removed, in each calling package's testdata/bashref: a test's calls must stay the ones recorded.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Root

func Root() string

Root is the repository's root, where agent-vm.sh was.

Types

type Cmd

type Cmd struct {
	Dir     string   `json:",omitempty"`
	Env     []string `json:",omitempty"`
	Stdin   string   `json:",omitempty"`
	Snippet string
	Args    []string `json:",omitempty"`
	Files   []string `json:",omitempty"`
}

Cmd is a bash snippet, run after agent-vm.sh is sourced, with Args as "$@", from Dir (the repository's root when empty), with HOME in a temporary folder and Env added. Files are read once it has run.

type Result

type Result struct {
	Stdout, Stderr string
	Code           int
	Files          map[string]string `json:",omitempty"`
}

Result of a bash function. Files holds the content of each file asked for that exists afterwards.

func Exec

func Exec(t testing.TB, c Cmd) Result

Exec gives c's result as recorded. Skipped on Windows, never compared there.

func Run

func Run(t testing.TB, dir string, env []string, fn string, args ...string) Result

Run runs fn with args (see Cmd).

func Script

func Script(t testing.TB, dir string, env []string, snippet string, args ...string) Result

Script runs snippet with args (see Cmd).

Jump to

Keyboard shortcuts

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