assertions

package
v1.0.0-alpha.16 Latest Latest
Warning

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

Go to latest
Published: Jul 18, 2020 License: GPL-3.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DeepEqual

func DeepEqual(loggerFn assertionLoggerFn, expected, actual interface{}, msg ...string)

DeepEqual compares values using DeepEqual.

func Equal

func Equal(loggerFn assertionLoggerFn, expected, actual interface{}, msg ...string)

Equal compares values using comparison operator.

func ErrorContains

func ErrorContains(loggerFn assertionLoggerFn, want string, err error, msg ...string)

ErrorContains asserts that actual error contains wanted message.

func NoError

func NoError(loggerFn assertionLoggerFn, err error, msg ...string)

NoError asserts that error is nil.

func NotNil

func NotNil(loggerFn assertionLoggerFn, obj interface{}, msg ...string)

NotNil asserts that passed value is not nil.

Types

type AssertionTestingTB

type AssertionTestingTB interface {
	Errorf(format string, args ...interface{})
	Fatalf(format string, args ...interface{})
}

AssertionTestingTB exposes enough testing.TB methods for assertions.

type TBMock

type TBMock struct {
	ErrorfMsg string
	FatalfMsg string
}

TBMock exposes enough testing.TB methods for assertions.

func (*TBMock) Errorf

func (tb *TBMock) Errorf(format string, args ...interface{})

Errorf writes testing logs to ErrorfMsg.

func (*TBMock) Fatalf

func (tb *TBMock) Fatalf(format string, args ...interface{})

Fatalf writes testing logs to FatalfMsg.

Jump to

Keyboard shortcuts

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