should

package
v0.7.0 Latest Latest
Warning

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

Go to latest
Published: Jun 13, 2021 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrExpectedCountInvalid = errors.New("expected count invalid")
	ErrTypeMismatch         = errors.New("type mismatch")
	ErrKindMismatch         = errors.New("kind mismatch")
	ErrAssertionFailure     = errors.New("assertion failure")
)
View Source
var NOT negated

NOT (a singleton) constrains all negated assertions to their own namespace.

Functions

func BeEmpty

func BeEmpty(actual interface{}, expected ...interface{}) error

BeEmpty uses reflection to verify that len(actual) == 0.

func BeFalse

func BeFalse(actual interface{}, expected ...interface{}) error

BeFalse verifies that actual is the boolean false value.

func BeNil

func BeNil(actual interface{}, expected ...interface{}) error

BeNil verifies that actual is the nil value.

func BeTrue

func BeTrue(actual interface{}, expected ...interface{}) error

BeTrue verifies that actual is the boolean true value.

func Contain added in v0.7.0

func Contain(actual interface{}, expected ...interface{}) error

func Equal

func Equal(actual interface{}, EXPECTED ...interface{}) error

Equal verifies that the actual value is equal to the expected value. It uses reflect.DeepEqual in most cases.

func HaveLength added in v0.4.0

func HaveLength(actual interface{}, expected ...interface{}) error

HaveLength uses reflection to verify that len(actual) == 0.

func Panic added in v0.5.0

func Panic(actual interface{}, expected ...interface{}) (err error)

func WrapError added in v0.4.0

func WrapError(actual interface{}, expected ...interface{}) error

Types

This section is empty.

Jump to

Keyboard shortcuts

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