Documentation
¶
Index ¶
- func DeepEqual(tb TestingTB, expected interface{}, actual interface{}, msgs ...interface{})
- func DeepNotEqual(tb TestingTB, expected interface{}, actual interface{}, msgs ...interface{})
- func DeepNotSSZEqual(tb TestingTB, expected interface{}, actual interface{}, msgs ...interface{})
- func DeepSSZEqual(tb TestingTB, expected interface{}, actual interface{}, msgs ...interface{})
- func Equal(tb TestingTB, expected interface{}, actual interface{}, msgs ...interface{})
- func ErrorContains(tb TestingTB, want string, err error, msgs ...interface{})
- func ErrorIs(tb TestingTB, target error, err error, msgs ...interface{})
- func Fail(tb TestingTB, msgs ...interface{})
- func False(tb TestingTB, actual bool, msgs ...interface{})
- func LogsContain(tb TestingTB, hook *test.Hook, want string, msgs ...interface{})
- func LogsDoNotContain(tb TestingTB, hook *test.Hook, want string, msgs ...interface{})
- func Nil(tb TestingTB, obj interface{}, msgs ...interface{})
- func NoError(tb TestingTB, err error, msgs ...interface{})
- func NotEmpty(tb TestingTB, obj interface{}, msgs ...interface{})
- func NotEqual(tb TestingTB, expected interface{}, actual interface{}, msgs ...interface{})
- func NotNil(tb TestingTB, obj interface{}, msgs ...interface{})
- func Panic(tb TestingTB, f func(), msgs ...interface{})
- func True(tb TestingTB, actual bool, msgs ...interface{})
- type TestingTB
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DeepEqual ¶
func DeepEqual( tb TestingTB, expected interface{}, actual interface{}, msgs ...interface{}, )
DeepEqual compares values using DeepEqual. NOTE: this function does not work for checking arrays/slices or maps of protobuf messages. For arrays/slices, please use DeepSSZEqual. For maps, please iterate through and compare the individual keys and values.
func DeepNotEqual ¶
func DeepNotEqual( tb TestingTB, expected interface{}, actual interface{}, msgs ...interface{}, )
DeepNotEqual compares values using DeepEqual. NOTE: this function does not work for checking arrays/slices or maps of protobuf messages. For arrays/slices, please use DeepNotSSZEqual. For maps, please iterate through and compare the individual keys and values.
func DeepNotSSZEqual ¶
func DeepNotSSZEqual( tb TestingTB, expected interface{}, actual interface{}, msgs ...interface{}, )
DeepNotSSZEqual compares values using DeepEqual.
func DeepSSZEqual ¶
func DeepSSZEqual( tb TestingTB, expected interface{}, actual interface{}, msgs ...interface{}, )
DeepSSZEqual compares values using DeepEqual.
func Equal ¶
func Equal( tb TestingTB, expected interface{}, actual interface{}, msgs ...interface{}, )
Equal compares values using comparison operator.
func ErrorContains ¶
ErrorContains asserts that actual error contains wanted message.
func ErrorIs ¶
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 LogsContain ¶
LogsContain checks that the desired string is a subset of the current log output.
func LogsDoNotContain ¶
LogsDoNotContain is the inverse check of LogsContain.
func Nil ¶
func Nil(tb TestingTB, obj interface{}, msgs ...interface{})
Nil asserts that passed value is nil.
func NotEmpty ¶
func NotEmpty(tb TestingTB, obj interface{}, msgs ...interface{})
NotEmpty checks that the object fields are not empty. This method also checks all of the pointer fields to ensure none of those fields are empty.
func NotEqual ¶
func NotEqual( tb TestingTB, expected interface{}, actual interface{}, msgs ...interface{}, )
NotEqual compares values using comparison operator.