test

package
v1.4.0 Latest Latest
Warning

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

Go to latest
Published: Sep 1, 2022 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Assert

func Assert(tb testing.TB, condition bool, msg string, v ...interface{})

Assert fails the test if the condition is false.

func CreateTempDir

func CreateTempDir(tb testing.TB, name string, in ...string) (string, func())

CreateTempDir is a test helper to create a temporary directory, in given directory.

func CreateTempFile

func CreateTempFile(tb testing.TB, name string, content []byte, in ...string) (string, func())

CreateTempFile is a test helper to create a temporary file with given name and content, in given directory.

func CreateTempFilesInDir

func CreateTempFilesInDir(tb testing.TB, name string, content []byte, in ...string) (string, func())

CreateTempFilesInDir is a test helper to create temporary files using name as prefix and content, in given directory.

func EqualDirs

func EqualDirs(tb testing.TB, dst string, src string, srcs []string)

nolint:funlen // EqualDirs fails if the contents of given directories are not the same.

func Equals

func Equals(tb testing.TB, want, got interface{}, v ...interface{})

Equals fails the test if want is not equal to got.

func Exists

func Exists(tb testing.TB, path string)

Exists fails if the file or directory in the given path does not exist.

func Expected

func Expected(tb testing.TB, got, want error)

Expected fails if the errors does not match.

func NotOk

func NotOk(tb testing.TB, err error)

NotOk fails the test if an err is nil.

func Ok

func Ok(tb testing.TB, err error)

Ok fails the test if an err is not nil.

Types

This section is empty.

Jump to

Keyboard shortcuts

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