testutil

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Sep 25, 2026 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Overview

Package testutil holds helpers shared by tests.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FakeBins

func FakeBins(t *testing.T, scripts map[string]string) string

FakeBins puts fake executables at the front of PATH for the duration of the test and returns the directory holding them. Each map key is an executable name and each value is the body of a POSIX shell script. Tests that use it are skipped on Windows.

The rest of the real PATH is kept after the fake directory, so anything the fake scripts need beyond externalTools still resolves normally, but any directory that itself provides a real protectedBinaries entry is dropped from it. Without this, a test that omits e.g. "docker" from scripts to simulate it being entirely absent can be defeated by a real docker sitting in a directory that was only kept on PATH for basic tools.

Types

This section is empty.

Jump to

Keyboard shortcuts

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