2022-03-28 13:56:44 -04:00
|
|
|
package prototest
|
|
|
|
|
|
|
|
import (
|
|
|
|
"testing"
|
|
|
|
|
|
|
|
"github.com/google/go-cmp/cmp"
|
2022-05-25 12:37:44 -05:00
|
|
|
"google.golang.org/protobuf/testing/protocmp"
|
2022-03-28 13:56:44 -04:00
|
|
|
)
|
|
|
|
|
2022-06-01 14:31:37 -06:00
|
|
|
func AssertDeepEqual(t testing.TB, x, y interface{}, opts ...cmp.Option) {
|
2022-03-28 13:56:44 -04:00
|
|
|
t.Helper()
|
2022-03-29 13:17:41 -05:00
|
|
|
|
2022-05-25 12:37:44 -05:00
|
|
|
opts = append(opts, protocmp.Transform())
|
2022-03-29 13:17:41 -05:00
|
|
|
|
2022-03-28 13:56:44 -04:00
|
|
|
if diff := cmp.Diff(x, y, opts...); diff != "" {
|
|
|
|
t.Fatalf("assertion failed: values are not equal\n--- expected\n+++ actual\n%v", diff)
|
|
|
|
}
|
|
|
|
}
|