Documentation
¶
Index ¶
- func BoolPtr(v bool) *bool
- func ForbidExec(t *testing.T, target *func(string, []string, []string) error)
- func WithWorkingDir(t *testing.T, dir string, fn func())
- func WriteStub(t *testing.T, dir string, name string)
- func WriteStubExpectArg(t *testing.T, dir string, name string, expectedArg string)
- func WriteStubWithExit(t *testing.T, dir string, name string, exitCode int)
- type ExecCall
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ForbidExec ¶ added in v0.14.0
ForbidExec replaces target with a test failure and restores the original handoff when the test completes.
func WithWorkingDir ¶
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 ¶
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 ¶
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.
Types ¶
type ExecCall ¶ added in v0.14.0
ExecCall records one captured executable handoff.
func CaptureExec ¶ added in v0.14.0
CaptureExec replaces target with a one-call capture seam that returns err. It restores the original handoff when the test completes.