github.com/cosmos/cosmos-sdk@v0.50.10/testutil/compare.go (about) 1 package testutil 2 3 import ( 4 "testing" 5 6 "github.com/google/go-cmp/cmp" 7 "github.com/stretchr/testify/require" 8 "google.golang.org/protobuf/testing/protocmp" 9 ) 10 11 // RequireProtoDeepEqual fails the test t if p1 and p2 are not equivalent protobuf messages. 12 // Where p1 and p2 are proto.Message or slices of proto.Message. 13 func RequireProtoDeepEqual(t *testing.T, p1, p2 interface{}) { 14 t.Helper() 15 require.Empty(t, cmp.Diff(p1, p2, protocmp.Transform())) 16 }