Documentation ¶
Index ¶
- func NewTestVersion(t *testing.T, version string) buildpack.Version
- func ProtectEnv(t *testing.T, keys ...string) func()
- func ReplaceArgs(t *testing.T, args ...string) func()
- func ReplaceWorkingDirectory(t *testing.T, dir string) func()
- func ScratchDir(t *testing.T, prefix string) string
- func WriteTomlFile(filename string, perm os.FileMode, value interface{}) error
- type Console
- type Iterator
- type Set
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewTestVersion ¶ added in v1.28.0
func ProtectEnv ¶ added in v1.28.0
ProtectEnv protects a collection of environment variables. Returns a function for use with defer in order to reset the previous values.
defer ProtectEnv(t, "alpha")()
func ReplaceArgs ¶
ReplaceArgs replaces the current command line arguments (os.Args) with a new collection of values. Returns a function suitable for use with defer in order to reset the previous values
defer ReplaceArgs(t, "alpha")()
func ReplaceWorkingDirectory ¶
ReplaceWorkingDirectory replaces the current working directory (os.Getwd()) with a new value. Returns a function for use with defer in order to reset the previous value
defer ReplaceWorkingDirectory(t, "alpha")()
func ScratchDir ¶
ScratchDir returns a safe scratch directory for tests to modify.
Types ¶
type Console ¶
type Console struct {
// contains filtered or unexported fields
}
Console represents the standard console objects, stdin, stdout, and stderr.
func ReplaceConsole ¶
ReplaceConsole replaces the console files (os.Stderr, os.Stdin, os.Stdout). Returns a function for use with defer in order to reset the previous values
c, d := ReplaceConsole(t) defer d()
type Iterator ¶ added in v1.28.0
type Iterator <-chan interface{}
Iterator is a type that range-able.
type Set ¶ added in v1.28.0
type Set struct {
// contains filtered or unexported fields
}
Set represents the mathematical type set.
func (Set) Difference ¶ added in v1.28.0
Difference provides the logical difference between this set and another. Only elements that exist in this set and not the other will be in the resulting set.