From 9d75cb8c2942358370daa3b3a1b98148d5f3575f Mon Sep 17 00:00:00 2001 From: Josh Humphries Date: Mon, 30 Apr 2018 22:32:45 -0400 Subject: [PATCH] use proto.Equal to compare protos --- runtime/marshal_proto_test.go | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/runtime/marshal_proto_test.go b/runtime/marshal_proto_test.go index 535f3991d9d..1da30b8a8d6 100644 --- a/runtime/marshal_proto_test.go +++ b/runtime/marshal_proto_test.go @@ -1,10 +1,10 @@ package runtime_test import ( - "reflect" + "bytes" "testing" - "bytes" + "github.com/golang/protobuf/proto" "github.com/golang/protobuf/ptypes/timestamp" "github.com/grpc-ecosystem/grpc-gateway/examples/proto/examplepb" "github.com/grpc-ecosystem/grpc-gateway/runtime" @@ -51,7 +51,7 @@ func TestProtoMarshalUnmarshal(t *testing.T) { t.Fatalf("Unmarshalling returned error: %s", err.Error()) } - if !reflect.DeepEqual(unmarshalled, message) { + if !proto.Equal(unmarshalled, message) { t.Errorf( "Unmarshalled didn't match original message: (original = %v) != (unmarshalled = %v)", unmarshalled, @@ -81,7 +81,7 @@ func TestProtoEncoderDecodert(t *testing.T) { t.Fatalf("Unmarshalling returned error: %s", err.Error()) } - if !reflect.DeepEqual(unencoded, message) { + if !proto.Equal(unencoded, message) { t.Errorf( "Unencoded didn't match original message: (original = %v) != (unencoded = %v)", unencoded,