assert

package
v7.0.1+incompatible Latest Latest
Warning

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

Go to latest
Published: Aug 25, 2022 License: Apache-2.0, BSD-2-Clause, BSD-3-Clause, + 1 more Imports: 3 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Equal

func Equal(t *testing.T, a, b interface{}, msgAndArgs ...interface{}) bool

Equal asserts that two objects are equal.

func Error

func Error(t *testing.T, err error, msgAndArgs ...interface{}) bool

Error asserts that a function returned an error (i.e. not `nil`).

func Exactly

func Exactly(t *testing.T, a, b interface{}, msgAndArgs ...interface{}) bool

Exactly asserts that two objects are equal in value and type.

func GreaterOrEqual

func GreaterOrEqual(t *testing.T, a, b int, msgAndArgs ...interface{}) bool

GreaterOrEqual asserts that the first element is greater than or equal to the second

func NoError

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

NoError asserts that a function returned no error (i.e. `nil`).

func NotEqual

func NotEqual(t *testing.T, a, b interface{}, msgAndArgs ...interface{}) bool

NotEqual asserts that two objects are NOT equal.

func NotNil

func NotNil(t *testing.T, a interface{}, msgAndArgs ...interface{}) bool

NotNil asserts that the specified object is not nil.

func RequireEqual

func RequireEqual(t *testing.T, a, b interface{}, msgAndArgs ...interface{})

RequireEqual asserts that two objects are equal. It marks the test as failed and stops execution.

func RequireGreaterOrEqual

func RequireGreaterOrEqual(t *testing.T, a, b int, msgAndArgs ...interface{})

RequireGreaterOrEqual asserts that the first element is greater than or equal to the second It marks the test as failed and stops execution.

func RequireNoError

func RequireNoError(t *testing.T, err error, msgAndArgs ...interface{})

RequireNoError asserts that a function returned no error (i.e. `nil`). It marks the test as failed and stops execution.

func RequireNotEqual

func RequireNotEqual(t *testing.T, a, b interface{}, msgAndArgs ...interface{})

RequireNotEqual asserts that two objects are NOT equal. It marks the test as failed and stops execution.

func RequireNotNil

func RequireNotNil(t *testing.T, a interface{}, msgAndArgs ...interface{})

RequireNotNil asserts that the specified object is not nil. It marks the test as failed and stops execution.

Types

This section is empty.

Jump to

Keyboard shortcuts

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