Use proto.Equal for equalities on Go proto messages (#1204)

This commit is contained in:
Menghan Li
2017-04-27 10:19:45 -07:00
committed by GitHub
parent c73e0165df
commit a7fee9febf
2 changed files with 4 additions and 3 deletions

View File

@ -94,7 +94,7 @@ func TestFileDescForType(t *testing.T) {
{reflect.TypeOf(pb.ToBeExtended{}), fdProto2},
} {
fd, err := s.fileDescForType(test.st)
if err != nil || !reflect.DeepEqual(fd, test.wantFd) {
if err != nil || !proto.Equal(fd, test.wantFd) {
t.Errorf("fileDescForType(%q) = %q, %v, want %q, <nil>", test.st, fd, err, test.wantFd)
}
}
@ -138,7 +138,7 @@ func TestFileDescContainingExtension(t *testing.T) {
{reflect.TypeOf(pb.ToBeExtended{}), 29, fdProto2Ext2},
} {
fd, err := s.fileDescContainingExtension(test.st, test.extNum)
if err != nil || !reflect.DeepEqual(fd, test.want) {
if err != nil || !proto.Equal(fd, test.want) {
t.Errorf("fileDescContainingExtension(%q) = %q, %v, want %q, <nil>", test.st, fd, err, test.want)
}
}