testutil

package
v0.0.0-...-ea2487c Latest Latest
Warning

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

Go to latest
Published: Aug 16, 2026 License: BSD-3-Clause, BSD-3-Clause Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AssertCmp

func AssertCmp(t *testing.T, got interface{}, want interface{}, opts ...cmp.Option)

AssertCmp fails a test with a descriptive diff if got != want, respecting a set of compare options.

func AssertProtoEqual

func AssertProtoEqual(t *testing.T, got interface{}, want interface{})

func CheckNoFDLeaks

func CheckNoFDLeaks(t *testing.T)

CheckNoFDLeaks records the current number of file descriptors and registers a cleanup check that fails the test if the count does not return to that baseline. It is Linux-specific; on systems without /proc/self/fd it logs and becomes a no-op.

func MustRunfile

func MustRunfile(path string) string

func TempDir

func TempDir(t testing.TB) string

TempDir creates a temporary directory in the test runner's designated scratch space and removes it when the test completes.

Types

type FS

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

func NewFS

func NewFS(t *testing.T, files map[string][]byte) *FS

func (*FS) Open

func (f *FS) Open(name string) (fs.File, error)

Jump to

Keyboard shortcuts

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