Documentation
¶
Index ¶
- Variables
- func Equal(t *testing.T, handleType HandleType, expected interface{}, actual interface{}, ...)
- func EqualError(t *testing.T, handleType HandleType, expected error, actual error, ...)
- func Nil(t *testing.T, handleType HandleType, actual interface{}, ...)
- func NoError(t *testing.T, handleType HandleType, err error, messages ...interface{})
- func NotEqual(t *testing.T, handleType HandleType, expected interface{}, actual interface{}, ...)
- func NotNil(t *testing.T, handleType HandleType, actual interface{}, ...)
- func ProtoEqual(t *testing.T, handleType HandleType, expected proto.Message, ...)
- func ProtoNotEqual(t *testing.T, handleType HandleType, expected proto.Message, ...)
- func SprintMessages(text string, messages []interface{}) string
- func UnorderedListEqual(t *testing.T, handleType HandleType, expectedList interface{}, ...)
- type HandleType
Constants ¶
This section is empty.
Variables ¶
View Source
var ProtoJSONMarshaler = &jsonpb.Marshaler{ EnumsAsInts: false, EmitDefaults: false, Indent: "\t", OrigName: false, }
View Source
var SpewConfig = spew.ConfigState{ Indent: "\t", DisableMethods: true, DisablePointerAddresses: true, ContinueOnMethod: true, }
Functions ¶
func Equal ¶
func Equal( t *testing.T, handleType HandleType, expected interface{}, actual interface{}, messages ...interface{}, )
If not equal then handle.
func EqualError ¶
func EqualError( t *testing.T, handleType HandleType, expected error, actual error, messages ...interface{}, )
If equal then handle.
func Nil ¶
func Nil( t *testing.T, handleType HandleType, actual interface{}, messages ...interface{}, )
If not nil then handle.
func NoError ¶
func NoError( t *testing.T, handleType HandleType, err error, messages ...interface{}, )
If has error then handle.
func NotEqual ¶
func NotEqual( t *testing.T, handleType HandleType, expected interface{}, actual interface{}, messages ...interface{}, )
If equal then handle.
func NotNil ¶
func NotNil( t *testing.T, handleType HandleType, actual interface{}, messages ...interface{}, )
If nil then handle.
func ProtoEqual ¶
func ProtoEqual( t *testing.T, handleType HandleType, expected proto.Message, actual proto.Message, messages ...interface{}, )
If not equal then handle.
func ProtoNotEqual ¶
func ProtoNotEqual( t *testing.T, handleType HandleType, expected proto.Message, actual proto.Message, messages ...interface{}, )
If equal then handle.
func SprintMessages ¶
func UnorderedListEqual ¶
func UnorderedListEqual( t *testing.T, handleType HandleType, expectedList interface{}, actualList interface{}, messages ...interface{}, )
If not equal then handle.
expectedList and actualList can be slice, array or nil. Compare type and elements with ignoring the order. For example,
- [1]int{} is not equal to []int{}
- []int{1, 1, 2} is equal to []int{2, 1, 1}
The time complexity is O(n^2).
Types ¶
type HandleType ¶
type HandleType int
const ( ErrorHandle HandleType = iota FatalHandle )
func (HandleType) String ¶
func (i HandleType) String() string
Click to show internal directories.
Click to hide internal directories.