testutil

package
v1.0.3 Latest Latest
Warning

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

Go to latest
Published: Mar 22, 2019 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Overview

Reimport the go-cmp package as the name 'cmp' conflicts with the cmp instruction in the vm.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AllowUnexported

func AllowUnexported(types ...interface{}) cmp.Option

func Diff

func Diff(a, b interface{}, opts ...cmp.Option) string

func FatalIfErr added in v1.0.2

func FatalIfErr(tb testing.TB, err error)

FatalIfErr fails the test with a fatal error if err is not nil.

func IgnoreUnexported

func IgnoreUnexported(types ...interface{}) cmp.Option

func TestChdir

func TestChdir(tb testing.TB, dir string) func()

TestChdir changes current working directory, and returns a cleanup function to return to the previous directory.

func TestOpenFile

func TestOpenFile(tb testing.TB, name string) *os.File

TestOpenFile creates a new file called name and returns the opened file.

func TestTempDir

func TestTempDir(tb testing.TB) (string, func())

TestTempDir creates a temporary directory for use during tests. It returns the pathname, and a cleanup function.

func WriteString added in v1.0.2

func WriteString(tb testing.TB, f *os.File, str string) int

Types

This section is empty.

Jump to

Keyboard shortcuts

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