2020-07-13 15:19:52 +00:00
|
|
|
package require
|
|
|
|
|
|
|
|
import (
|
2020-07-15 20:10:54 +00:00
|
|
|
"github.com/prysmaticlabs/prysm/shared/testutil/assertions"
|
2020-07-13 15:19:52 +00:00
|
|
|
)
|
|
|
|
|
|
|
|
// Equal compares values using comparison operator.
|
2020-07-19 04:45:04 +00:00
|
|
|
func Equal(tb assertions.AssertionTestingTB, expected, actual interface{}, msg ...string) {
|
|
|
|
assertions.Equal(tb.Fatalf, expected, actual, msg...)
|
2020-07-13 15:19:52 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
// DeepEqual compares values using DeepEqual.
|
2020-07-19 04:45:04 +00:00
|
|
|
func DeepEqual(tb assertions.AssertionTestingTB, expected, actual interface{}, msg ...string) {
|
|
|
|
assertions.DeepEqual(tb.Fatalf, expected, actual, msg...)
|
2020-07-13 15:19:52 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
// NoError asserts that error is nil.
|
2020-07-15 20:10:54 +00:00
|
|
|
func NoError(tb assertions.AssertionTestingTB, err error, msg ...string) {
|
|
|
|
assertions.NoError(tb.Fatalf, err, msg...)
|
2020-07-13 15:19:52 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
// ErrorContains asserts that actual error contains wanted message.
|
2020-07-15 20:10:54 +00:00
|
|
|
func ErrorContains(tb assertions.AssertionTestingTB, want string, err error, msg ...string) {
|
|
|
|
assertions.ErrorContains(tb.Fatalf, want, err, msg...)
|
2020-07-13 15:19:52 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
// NotNil asserts that passed value is not nil.
|
2020-07-15 20:10:54 +00:00
|
|
|
func NotNil(tb assertions.AssertionTestingTB, obj interface{}, msg ...string) {
|
|
|
|
assertions.NotNil(tb.Fatalf, obj, msg...)
|
2020-07-13 15:19:52 +00:00
|
|
|
}
|