assert

package
v1.7.1 Latest Latest
Warning

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

Go to latest
Published: Jan 11, 2022 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func PanicCatcher

func PanicCatcher(action func()) (thePanic interface{})

Types

type Matcher

type Matcher func(actual interface{}) (match bool, message string)

func CreateMatcher

func CreateMatcher(match MatcherImplementation, message MessageProvider) Matcher

Helper functions

func CreateNotMatcher

func CreateNotMatcher(match MatcherImplementation, message MessageProvider) Matcher

type MatcherImplementation

type MatcherImplementation func(actual interface{}) (match bool, message string)

type MessageProvider

type MessageProvider func(actual interface{}, extra string) string

type Wrapper

type Wrapper struct {
	T *testing.T
}

Wrapper around T to allow extension functions

func Assert

func Assert(t *testing.T) Wrapper

func (Wrapper) Fail

func (a Wrapper) Fail(format string, args ...interface{})

func (Wrapper) Logf

func (a Wrapper) Logf(format string, args ...interface{})

func (Wrapper) That

func (a Wrapper) That(actual interface{}, matcher Matcher, reasonFormat string, reasonArgs ...interface{})

func (Wrapper) ThatEventually

func (a Wrapper) ThatEventually(ctx context.Context, actual func() interface{}, matcher Matcher, reasonFormat string, reasonArgs ...interface{})

Jump to

Keyboard shortcuts

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