assert

package
v1.8.0 Latest Latest
Warning

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

Go to latest
Published: Feb 16, 2024 License: Apache-2.0 Imports: 7 Imported by: 3

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Eq

func Eq(t *testing.T, expected interface{}, actual interface{})

Eq asserts the values are equal. Uses reflect.DeepEqual to test for equality

func EqItems added in v0.9.0

func EqItems(t *testing.T, expected interface{}, actual interface{})

EqItems asserts the given slices have the same elements (regardless of their order)

func Err added in v1.1.0

func Err(t *testing.T, err error)

Err asserts the error is not nil

func Fail

func Fail(t *testing.T, text string)

Fail fails immediately

func Failf

func Failf(t *testing.T, format string, args ...interface{})

Failf fails immediately

func MustMatch added in v1.5.0

func MustMatch(t *testing.T, match *regexp.Regexp, value interface{})

MustMatch checks the value against a given regular expression.

func MustPanic added in v0.9.0

func MustPanic(t *testing.T, match *regexp.Regexp)

MustPanic ensures that the caller's context will panic and that the panic will match the given regular expression

  func() {
  	defer mustPanic(t, regexp.MustCompile("+*"))
		panic("some text")
  }

func NoErr

func NoErr(t *testing.T, err error)

NoErr asserts the error is nil

func NotEq added in v0.9.0

func NotEq(t *testing.T, notThisValue interface{}, actual interface{})

NotEq asserts the given values are not equal. Uses reflect.DeepEqual to test for equality

func NotNil added in v1.3.0

func NotNil(t *testing.T, actual interface{})

NotNil verifies that the given value is not nil

func StringChannelExpect added in v1.3.0

func StringChannelExpect(t *testing.T, expected string, channel chan string, timeout time.Duration)

StringChannelExpect that the given channel receives the expected string next, with the given timeout

func StringChannelMustTimeout added in v1.3.0

func StringChannelMustTimeout(t *testing.T, channel chan string, timeout time.Duration)

func True added in v1.0.0

func True(t *testing.T, actual interface{})

True asserts that the given value is a boolean true

Types

This section is empty.

Jump to

Keyboard shortcuts

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