assertion

package
v0.0.0-...-a26ebea Latest Latest
Warning

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

Go to latest
Published: Apr 7, 2022 License: AGPL-3.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Assert

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

func Error

func Error(tb testing.TB, opts ...cmp.Option) Assert

Error asserts using Error logger.

Helpful for consuming the boolean result of an assertion.

func Fatal

func Fatal(tb testing.TB, opts ...cmp.Option) Assert

Fatal asserts using Fatal logger.

Helpful for immediately aborting test execution on failed assertion.

func New

func New(tb testing.TB, log log, opts ...cmp.Option) Assert

New creates a new Assert with the given params.

func (Assert) Assert

func (a Assert) Assert(condition bool, format string, args ...any) bool

Assert fails the test if the condition is false.

func (Assert) Equal

func (a Assert) Equal(got, want any) bool

Equal fails the test if got is not equal to want.

func (Assert) NotOK

func (a Assert) NotOK(err error) bool

NotOK fails the test if err is nil.

func (Assert) OK

func (a Assert) OK(err error) bool

OK fails the test if err is not nil.

Jump to

Keyboard shortcuts

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