Documentation
¶
Overview ¶
Package assert 提供了一些常用的断言函数。
Package assert is a generated GoMock package.
Index ¶
- func Check(cases Cases) error
- func Equal(t T, got interface{}, expect interface{}, msg ...string)
- func Error(t T, got error, expr string, msg ...string)
- func False(t T, got bool, msg ...string)
- func Implements(t T, got interface{}, expect interface{}, msg ...string)
- func Matches(t T, got string, expr string, msg ...string)
- func Nil(t T, got interface{}, msg ...string)
- func NotEqual(t T, got interface{}, expect interface{}, msg ...string)
- func NotNil(t T, got interface{}, msg ...string)
- func NotSame(t T, got interface{}, expect interface{}, msg ...string)
- func Panic(t T, fn func(), expr string, msg ...string)
- func Same(t T, got interface{}, expect interface{}, msg ...string)
- func True(t T, got bool, msg ...string)
- func TypeOf(t T, got interface{}, expect interface{}, msg ...string)
- type Cases
- type MockT
- type MockTMockRecorder
- type T
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Implements ¶
Implements asserts that got implements expect.
func Panic ¶
Panic asserts that function fn() would panic. It fails if the panic message does not match the regular expression.
Types ¶
type MockT ¶
type MockT struct {
// contains filtered or unexported fields
}
MockT is a mock of T interface.
func (*MockT) EXPECT ¶
func (m *MockT) EXPECT() *MockTMockRecorder
EXPECT returns an object that allows the caller to indicate expected use.
type MockTMockRecorder ¶
type MockTMockRecorder struct {
// contains filtered or unexported fields
}
MockTMockRecorder is the mock recorder for MockT.
func (*MockTMockRecorder) Fail ¶
func (mr *MockTMockRecorder) Fail() *gomock.Call
Fail indicates an expected call of Fail.
func (*MockTMockRecorder) Helper ¶
func (mr *MockTMockRecorder) Helper() *gomock.Call
Helper indicates an expected call of Helper.
func (*MockTMockRecorder) Log ¶
func (mr *MockTMockRecorder) Log(args ...interface{}) *gomock.Call
Log indicates an expected call of Log.
Click to show internal directories.
Click to hide internal directories.