prysm-pulse/shared/testutil/require/requires.go
Victor Farazdagi 77d1a6c698
Adds testutils/assert and testutils/require (#6563)
* testutils/assert

* adds assertion tb mock

* testutil/require

* gazelle

* comment public types

* set TestOnly attribute

* fixes package name

Co-authored-by: prylabs-bulldozer[bot] <58059840+prylabs-bulldozer[bot]@users.noreply.github.com>
2020-07-13 10:19:52 -05:00

31 lines
1019 B
Go

package require
import (
"github.com/prysmaticlabs/prysm/shared/testutil"
)
// Equal compares values using comparison operator.
func Equal(tb testutil.AssertionTestingTB, expected, actual interface{}, msg ...string) {
testutil.Equal(tb.Fatalf, expected, actual, msg...)
}
// DeepEqual compares values using DeepEqual.
func DeepEqual(tb testutil.AssertionTestingTB, expected, actual interface{}, msg ...string) {
testutil.DeepEqual(tb.Fatalf, expected, actual, msg...)
}
// NoError asserts that error is nil.
func NoError(tb testutil.AssertionTestingTB, err error, msg ...string) {
testutil.NoError(tb.Fatalf, err, msg...)
}
// ErrorContains asserts that actual error contains wanted message.
func ErrorContains(tb testutil.AssertionTestingTB, want string, err error, msg ...string) {
testutil.ErrorContains(tb.Fatalf, want, err, msg...)
}
// NotNil asserts that passed value is not nil.
func NotNil(tb testutil.AssertionTestingTB, obj interface{}, msg ...string) {
testutil.NotNil(tb.Fatalf, obj, msg...)
}