internal

package
v1.75.0 Latest Latest
Warning

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

Go to latest
Published: Jun 28, 2019 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewTestVersion added in v1.28.0

func NewTestVersion(t *testing.T, version string) buildpack.Version

func ProtectEnv added in v1.28.0

func ProtectEnv(t *testing.T, keys ...string) func()

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

func ReplaceArgs(t *testing.T, args ...string) func()

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

func ReplaceWorkingDirectory(t *testing.T, dir string) func()

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 WriteTomlFile added in v1.28.0

func WriteTomlFile(filename string, perm os.FileMode, value interface{}) error

WriteTomlFile writes a file with a TOML representation of the given value. Before writing it creates all required parent directories for the file.

Types

type Console

type Console struct {
	// contains filtered or unexported fields
}

Console represents the standard console objects, stdin, stdout, and stderr.

func ReplaceConsole

func ReplaceConsole(t *testing.T) (Console, func())

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()

func (Console) Err

func (c Console) Err(t *testing.T) string

Err returns a string representation of captured stderr.

func (Console) In

func (c Console) In(t *testing.T, string string)

In writes a string and closes the connection once complete.

func (Console) Out

func (c Console) Out(t *testing.T) string

Out returns a string representation of captured stdout.

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 NewSet added in v1.28.0

func NewSet() Set

NewSet creates an initialized and empty Set.

func (Set) Add added in v1.28.0

func (s Set) Add(v interface{})

Add adds an element to the set.

func (Set) Contains added in v1.28.0

func (s Set) Contains(v interface{}) bool

Contains returns whether the set contains an item.

func (Set) Difference added in v1.28.0

func (s Set) Difference(other Set) Set

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.

func (Set) Iterator added in v1.28.0

func (s Set) Iterator() Iterator

Iterator returns the values to be ranged over.

func (Set) Size added in v1.28.0

func (s Set) Size() int

Size returns the number of elements in the set.

Jump to

Keyboard shortcuts

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