testutil

package
v0.9.0 Latest Latest
Warning

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

Go to latest
Published: Mar 2, 2026 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BoolPtr

func BoolPtr(v bool) *bool

BoolPtr returns a pointer to v. v is the boolean value to take the address of.

func WithWorkingDir

func WithWorkingDir(t *testing.T, dir string, fn func())

WithWorkingDir runs fn with dir as the current working directory and restores the previous directory. t is the active test; dir is the temporary working directory for fn.

func WriteStub

func WriteStub(t *testing.T, dir string, name string)

WriteStub writes an executable shell stub that exits successfully. t is the active test; dir is the output directory; name is the executable file name.

func WriteStubExpectArg

func WriteStubExpectArg(t *testing.T, dir string, name string, expectedArg string)

WriteStubExpectArg writes an executable shell stub that succeeds only when expectedArg is present. t is the active test; dir is the output directory; name is the executable file name.

func WriteStubWithExit

func WriteStubWithExit(t *testing.T, dir string, name string, exitCode int)

WriteStubWithExit writes an executable shell stub that exits with the provided code. t is the active test; dir is the output directory; name is the executable file name.

Types

This section is empty.

Jump to

Keyboard shortcuts

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