Documentation ¶
Index ¶
- func DeepEqual(loggerFn assertionLoggerFn, expected, actual interface{}, msg ...interface{})
- func DeepNotEqual(loggerFn assertionLoggerFn, expected, actual interface{}, msg ...interface{})
- func DeepNotSSZEqual(loggerFn assertionLoggerFn, expected, actual interface{}, msg ...interface{})
- func DeepSSZEqual(loggerFn assertionLoggerFn, expected, actual interface{}, msg ...interface{})
- func Equal(loggerFn assertionLoggerFn, expected, actual interface{}, msg ...interface{})
- func ErrorContains(loggerFn assertionLoggerFn, want string, err error, msg ...interface{})
- func ErrorIs(loggerFn assertionLoggerFn, err, target error, msg ...interface{})
- func IsNil(loggerFn assertionLoggerFn, got interface{}, msg ...interface{})
- func LogsContain(loggerFn assertionLoggerFn, hook *test.Hook, want string, flag bool, ...)
- func NoError(loggerFn assertionLoggerFn, err error, msg ...interface{})
- func NotEmpty(loggerFn assertionLoggerFn, obj interface{}, msg ...interface{})
- func NotEqual(loggerFn assertionLoggerFn, expected, actual interface{}, msg ...interface{})
- func NotNil(loggerFn assertionLoggerFn, obj interface{}, msg ...interface{})
- func ProtobufPrettyDiff(a, b interface{}) string
- func SprintfAssertionLoggerFn(s *string) assertionLoggerFn
- func StringContains(loggerFn assertionLoggerFn, expected, actual string, flag bool, ...)
- type AssertionTestingTB
- type TBMock
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DeepEqual ¶
func DeepEqual(loggerFn assertionLoggerFn, expected, actual interface{}, msg ...interface{})
DeepEqual compares values using DeepEqual.
func DeepNotEqual ¶
func DeepNotEqual(loggerFn assertionLoggerFn, expected, actual interface{}, msg ...interface{})
DeepNotEqual compares values using DeepEqual.
func DeepNotSSZEqual ¶
func DeepNotSSZEqual(loggerFn assertionLoggerFn, expected, actual interface{}, msg ...interface{})
DeepNotSSZEqual compares values using ssz.DeepEqual.
func DeepSSZEqual ¶
func DeepSSZEqual(loggerFn assertionLoggerFn, expected, actual interface{}, msg ...interface{})
DeepSSZEqual compares values using ssz.DeepEqual.
func Equal ¶
func Equal(loggerFn assertionLoggerFn, expected, actual interface{}, msg ...interface{})
Equal compares values using comparison operator.
func ErrorContains ¶
ErrorContains asserts that actual error contains wanted message.
func ErrorIs ¶
func ErrorIs(loggerFn assertionLoggerFn, err, target error, msg ...interface{})
ErrorIs uses Errors.Is to recursively unwrap err looking for target in the chain. If any error in the chain matches target, the assertion will pass.
func IsNil ¶
func IsNil(loggerFn assertionLoggerFn, got interface{}, msg ...interface{})
IsNil asserts that observed value is nil.
func LogsContain ¶
func LogsContain(loggerFn assertionLoggerFn, hook *test.Hook, want string, flag bool, msg ...interface{})
LogsContain checks whether a given substring is a part of logs. If flag=false, inverse is checked.
func NoError ¶
func NoError(loggerFn assertionLoggerFn, err error, msg ...interface{})
NoError asserts that error is nil.
func NotEmpty ¶
func NotEmpty(loggerFn assertionLoggerFn, obj interface{}, msg ...interface{})
NotEmpty asserts that an object's fields are not empty. This function recursively checks each pointer / struct field.
func NotEqual ¶
func NotEqual(loggerFn assertionLoggerFn, expected, actual interface{}, msg ...interface{})
NotEqual compares values using comparison operator.
func NotNil ¶
func NotNil(loggerFn assertionLoggerFn, obj interface{}, msg ...interface{})
NotNil asserts that passed value is not nil.
func ProtobufPrettyDiff ¶
func ProtobufPrettyDiff(a, b interface{}) string
func SprintfAssertionLoggerFn ¶
func SprintfAssertionLoggerFn(s *string) assertionLoggerFn
func StringContains ¶
func StringContains(loggerFn assertionLoggerFn, expected, actual string, flag bool, msg ...interface{})
StringContains checks whether a string contains specified substring. If flag is false, inverse is checked.
Types ¶
type AssertionTestingTB ¶
type AssertionTestingTB interface { Errorf(format string, args ...interface{}) Fatalf(format string, args ...interface{}) }
AssertionTestingTB exposes enough testing.TB methods for assertions.