testutil

package
v0.0.0-...-2e562ea Latest Latest
Warning

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

Go to latest
Published: Dec 18, 2023 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func EqualError

func EqualError(a, b error) bool

EqualError reports whether errors a and b are considered equal. They're equal if both are nil, or both are not nil and a.Error() == b.Error().

func ExpectError

func ExpectError(t *testing.T, want, got error) bool

ExpectError asserts that the errors are equal. Return value is true if the "want" argument is non-nil.

func ListFiles

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

ListFiles is a convenience debugging function to log the files under a given dir.

func MustPrepareTestFiles

func MustPrepareTestFiles(t *testing.T, files []testtools.FileSpec) (tmpDir string, filenames []string, clean func())

func MustReadAndPrepareTestFiles

func MustReadAndPrepareTestFiles(t *testing.T, files []testtools.FileSpec) (tmpDir string, filenames []string, clean func())

func MustReadTestFile

func MustReadTestFile(t *testing.T, dir string, filename string) string

func MustWriteTestFiles

func MustWriteTestFiles(t *testing.T, tmpDir string, files []testtools.FileSpec) []string

Types

This section is empty.

Jump to

Keyboard shortcuts

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