tester

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Aug 23, 2021 License: Apache-2.0 Imports: 4 Imported by: 3

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Empty

func Empty(t *testing.T, obj interface{}, msg ...string) bool

Empty asserts data is empty.

func Equal

func Equal(t *testing.T, expected interface{}, actual interface{}, msg ...string) bool

Equal asserts equality between two items.

func EqualError

func EqualError(t *testing.T, actual error, expected string, msg ...string) bool

EqualError asserts equality between two errors.

func Error

func Error(t *testing.T, err error, msg ...string) bool

Error asserts err.

func False

func False(t *testing.T, actual bool, msg ...string) bool

False asserts data is false.

func Len

func Len(t *testing.T, obj interface{}, len int, msg ...string) bool

Len asserts length of object.

func Nil

func Nil(t *testing.T, obj interface{}, msg ...string) bool

Nil asserts data is nil.

func NoError

func NoError(t *testing.T, err error, msg ...string) bool

NoError asserts no err.

func NotEmpty

func NotEmpty(t *testing.T, obj interface{}, msg ...string) bool

NotEmpty asserts data is not empty.

func NotEqual

func NotEqual(t *testing.T, expected interface{}, actual interface{}, msg ...string) bool

NotEqual asserts inequality between two items.

func NotNil

func NotNil(t *testing.T, obj interface{}, msg ...string) bool

NotNil asserts data is not nil.

func Panics

func Panics(t *testing.T, fn assert.PanicTestFunc, msg ...string) bool

Panics asserts if function trigger panic.

func True

func True(t *testing.T, actual bool, msg ...string) bool

True asserts data is true.

Types

type Name

type Name struct {
	Given, When, Then string
}

Name provides fields that can be construct into test name.

func (Name) Construct

func (n Name) Construct() string

Construct creates test name from given "Given, When and Then". It's mandatory for all fields.

Jump to

Keyboard shortcuts

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