errorassert

package
v0.0.2 Latest Latest
Warning

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

Go to latest
Published: Jun 11, 2024 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Equal

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

If not equal then error.

func EqualError

func EqualError(
	t *testing.T,
	expected error,
	actual error,
	messages ...interface{},
)

If not equal then error.

func Nil

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

If not nil then error.

func NoError

func NoError(
	t *testing.T,
	err error,
	messages ...interface{},
)

If has error then error.

func NotEqual

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

If equal then error.

func NotNil

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

If nil then error.

func ProtoEqual

func ProtoEqual(
	t *testing.T,
	expected proto.Message,
	actual proto.Message,
	messages ...interface{},
)

If not equal then error.

func ProtoNotEqual

func ProtoNotEqual(
	t *testing.T,
	expected proto.Message,
	actual proto.Message,
	messages ...interface{},
)

If equal then error.

func UnorderedListEqual

func UnorderedListEqual(
	t *testing.T,
	expectedList interface{},
	actualList interface{},
	messages ...interface{},
)

If not equal then error.

expectedList and actualList can be slice, array or nil. Compare type and elements with ignoring the order. For example,

  • [1]int{} is not equal to []int{}
  • []int{1, 1, 2} is equal to []int{2, 1, 1}

The time complexity is O(n^2).

Types

This section is empty.

Jump to

Keyboard shortcuts

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