Skip to content

Commit

Permalink
use proto.Equal to compare protos
Browse files Browse the repository at this point in the history
  • Loading branch information
jhump committed May 1, 2018
1 parent ae16d78 commit 9d75cb8
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions runtime/marshal_proto_test.go
Original file line number Diff line number Diff line change
@@ -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"
Expand Down Expand Up @@ -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,
Expand Down Expand Up @@ -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,
Expand Down

0 comments on commit 9d75cb8

Please sign in to comment.