goprotobuf: Handle XXX_unrecognized correctly.
In particular,
- add it to marshaled messages
- examine it in Clone, Equal
R=r
CC=golang-dev
http://codereview.appspot.com/6449091
diff --git a/proto/clone_test.go b/proto/clone_test.go
index c24dca9..d111b47 100644
--- a/proto/clone_test.go
+++ b/proto/clone_test.go
@@ -78,3 +78,10 @@
t.Error("Mutating clone changed the original")
}
}
+
+func TestCloneNil(t *testing.T) {
+ var m *pb.MyMessage
+ if c := proto.Clone(m); !proto.Equal(m, c) {
+ t.Errorf("Clone(%v) = %v", m, c)
+ }
+}