iassert

package
v1.0.2 Latest Latest
Warning

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

Go to latest
Published: Sep 5, 2023 License: MulanPSL-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Equal

func Equal(t T, got interface{}, expect interface{}, msg ...string)

Equal assertion failed when got and expect are not `deeply equal`.

func Error

func Error(t T, got error, expr string, msg ...string)

Error assertion failed when got `error` doesn't match expr expression.

func False

func False(t T, got bool, msg ...string)

False assertion failed when got is true.

func Implements

func Implements(t T, got interface{}, expect interface{}, msg ...string)

Implements assertion failed when got doesn't implement expect.

func JsonEqual

func JsonEqual(t T, got string, expect string, msg ...string)

JsonEqual assertion failed when got and expect are not `json equal`.

func Matches

func Matches(t T, got string, expr string, msg ...string)

Matches assertion failed when got doesn't match expr expression.

func Nil

func Nil(t T, got interface{}, msg ...string)

Nil assertion failed when got is not nil.

func NotEqual

func NotEqual(t T, got interface{}, expect interface{}, msg ...string)

NotEqual assertion failed when got and expect are `deeply equal`.

func NotNil

func NotNil(t T, got interface{}, msg ...string)

NotNil assertion failed when got is nil.

func NotSame

func NotSame(t T, got interface{}, expect interface{}, msg ...string)

NotSame assertion failed when got and expect are same.

func Panic

func Panic(t T, fn func(), expr string, msg ...string)

Panic assertion failed when fn doesn't panic or not match expr expression.

func Same

func Same(t T, got interface{}, expect interface{}, msg ...string)

Same assertion failed when got and expect are not same.

func True

func True(t T, got bool, msg ...string)

True assertion failed when got is false.

func TypeOf

func TypeOf(t T, got interface{}, expect interface{}, msg ...string)

TypeOf assertion failed when got and expect are not same type.

Types

type MockT

type MockT struct {
	// contains filtered or unexported fields
}

MockT is a mock of T interface.

func NewMockT

func NewMockT(ctrl *gomock.Controller) *MockT

NewMockT creates a new mock instance.

func (*MockT) EXPECT

func (m *MockT) EXPECT() *MockTMockRecorder

EXPECT returns an object that allows the caller to indicate expected use.

func (*MockT) Error

func (m *MockT) Error(args ...interface{})

Error mocks base method.

func (*MockT) Helper

func (m *MockT) Helper()

Helper mocks base method.

type MockTMockRecorder

type MockTMockRecorder struct {
	// contains filtered or unexported fields
}

MockTMockRecorder is the mock recorder for MockT.

func (*MockTMockRecorder) Error

func (mr *MockTMockRecorder) Error(args ...interface{}) *gomock.Call

Error indicates an expected call of Error.

func (*MockTMockRecorder) Helper

func (mr *MockTMockRecorder) Helper() *gomock.Call

Helper indicates an expected call of Helper.

type T

type T interface {
	Helper()
	Error(args ...interface{})
}

T is the minimum interface of *testing.T.

Jump to

Keyboard shortcuts

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