add missing line from prototest.AssertDeepEqual (#12645)

This commit is contained in:
R.B. Boyer 2022-03-29 13:17:41 -05:00 committed by GitHub
parent 8aebca5794
commit 64e1501bda
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 4 additions and 0 deletions

View File

@ -3,11 +3,15 @@ package prototest
import ( import (
"testing" "testing"
"github.com/golang/protobuf/proto"
"github.com/google/go-cmp/cmp" "github.com/google/go-cmp/cmp"
) )
func AssertDeepEqual(t *testing.T, x, y interface{}, opts ...cmp.Option) { func AssertDeepEqual(t *testing.T, x, y interface{}, opts ...cmp.Option) {
t.Helper() t.Helper()
opts = append(opts, cmp.Comparer(proto.Equal))
if diff := cmp.Diff(x, y, opts...); diff != "" { if diff := cmp.Diff(x, y, opts...); diff != "" {
t.Fatalf("assertion failed: values are not equal\n--- expected\n+++ actual\n%v", diff) t.Fatalf("assertion failed: values are not equal\n--- expected\n+++ actual\n%v", diff)
} }