ipld-eth-beacon-indexer/pkg/testhelpers/testhelper.go
Abdul Rabbani ed3d0be2b7 A very generic package for implementing PGX driver
I copied most of the code from the `statediff` service from within geth. The idea is that I can create formal DB packages, that can be utilized in other projects down the road.
2022-04-20 12:12:55 -04:00

24 lines
499 B
Go

package testhelpers
import (
"reflect"
"testing"
)
// ExpectEqual asserts the provided interfaces are deep equal
func ExpectEqual(t *testing.T, got interface{}, want interface{}) {
if !reflect.DeepEqual(got, want) {
t.Fatalf("Expected: %v\nActual: %v", want, got)
}
}
// ListContainsString used to check if a list of strings contains a particular string
func ListContainsString(sss []string, s string) bool {
for _, str := range sss {
if s == str {
return true
}
}
return false
}