test

package
v1.6.3 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CheckIsErr

func CheckIsErr(t testing.TB, err error, msg string)

CheckIsErr fails if err ==nil. Print msg as an error message.

func CheckMarshal added in v1.6.2

func CheckMarshal(
	t *testing.T,
	x, y interface {
		encoding.BinaryMarshaler
		encoding.BinaryUnmarshaler
	},
)

func CheckNoErr

func CheckNoErr(t testing.TB, err error, msg string)

CheckNoErr fails if err !=nil. Print msg as an error message.

func CheckOk added in v1.1.0

func CheckOk(result bool, msg string, t testing.TB)

CheckOk fails the test if result == false.

func CheckPanic

func CheckPanic(f func()) error

CheckPanic returns true if call to function 'f' caused panic.

func ReadGzip added in v1.6.2

func ReadGzip(path string) ([]byte, error)

Like os.ReadFile, but gunzip first.

func ReportError

func ReportError(t testing.TB, got, want interface{}, inputs ...interface{})

ReportError reports an error if got is different from want.

Types

type HexBytes added in v1.6.2

type HexBytes []byte

[]byte but is encoded in hex for JSON

func (HexBytes) MarshalJSON added in v1.6.2

func (b HexBytes) MarshalJSON() ([]byte, error)

func (*HexBytes) UnmarshalJSON added in v1.6.2

func (b *HexBytes) UnmarshalJSON(data []byte) (err error)

Jump to

Keyboard shortcuts

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