Documentation ¶
Index ¶
- func Assert(tb testing.TB, condition bool, msg string, v ...interface{})
- func Contains(tb testing.TB, exp interface{}, slice []string)
- func DirStructure(t *testing.T, structure map[string]interface{}) (string, func())
- func Equals(tb testing.TB, exp, act interface{})
- func ErrContains(tb testing.TB, substr string, act error)
- func ErrEquals(tb testing.TB, exp string, act error)
- func Ok(tb testing.TB, err error)
- func TempDir(t *testing.T) (string, func())
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Assert ¶
Assert fails the test if the condition is false. Taken from https://github.com/benbjohnson/testing.
func DirStructure ¶ added in v0.4.0
DirStructure creates a directory structure in a temporary directory. structure describes the dir structure. If the value is another map, then the key is the name of a directory. If the value is nil, then the key is the name of a file. It returns the path to the temp directory containing the defined structure and a cleanup function to delete the directory. Example usage:
tmpDir, cleanup := DirStructure(t, map[string]interface{}{ "pulldir": map[string]interface{}{ "project1": map[string]interface{}{ "main.tf": nil, }, "project2": map[string]interface{}{, "main.tf": nil, }, }, }) defer cleanup()
func Equals ¶
Equals fails the test if exp is not equal to act. Taken from https://github.com/benbjohnson/testing.
func ErrContains ¶ added in v0.4.0
ErrContains fails the test if act is nil or act.Error() does not contain substr.
func Ok ¶
Ok fails the test if an err is not nil. Taken from https://github.com/benbjohnson/testing.
Types ¶
This section is empty.