testutil

package
v0.0.0-...-341c48f Latest Latest
Warning

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

Go to latest
Published: Dec 2, 2022 License: BSD-3-Clause Imports: 8 Imported by: 0

Documentation

Overview

Package testutil contains helper functions for writing tests.

Patterned after google.golang.org/cloud/internal/testutil.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func MustTempDir

func MustTempDir() (string, func())

MustTempDir returns a randomly generated temp dir from ioutil.TempDir and a cleanup function. Any encountered err results in a panic.

func NewTestLogger

func NewTestLogger() (log.Logger, *bytes.Buffer)

NewTestLogger returns a logger that logs to the returned buffer. Timestamps, caller, and stacktraces are disabled to make it easier to validate log output. Test coverage for timestamp, caller, and stacktrace output can be found in github.com/magma/magma/src/go/log/zap/zap_integ_test.go.

Types

This section is empty.

Jump to

Keyboard shortcuts

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