assert

package
v2.1.3 Latest Latest
Warning

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

Go to latest
Published: Nov 2, 2023 License: MIT Imports: 2 Imported by: 0

Documentation

Overview

Package assert provides a tool to test error groups:

func TestMyCode(t *testing.T) {
	err := errors.Group(fmt.Errorf("error 1"), fmt.Errorf("error 2"))
	assert.EqualErrorGroup(t, err, []string{"error 1", "error 2"})
}

This package requires https://github.com/stretchr/testify.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func EqualErrorGroup

func EqualErrorGroup(t testingT, err error, msgs []string)

EqualErrorGroup asserts that the given error is a group of errors with the following messages. It asserts the given error is equal to nil whenever `len(msgs) == 0`.

see grouperror.Collection

Types

This section is empty.

Jump to

Keyboard shortcuts

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