goprotobuf: Repeated extensions.
Also picks up a tweak to the JSON tags of the XXX_ fields.
R=r
CC=golang-dev
http://codereview.appspot.com/6175045
diff --git a/proto/text_parser_test.go b/proto/text_parser_test.go
index 6212e9e..dbd6b2c 100644
--- a/proto/text_parser_test.go
+++ b/proto/text_parser_test.go
@@ -64,6 +64,16 @@
return UnmarshalTextTest{in: text, out: msg}
}
+func buildExtRepStringTest(text string) UnmarshalTextTest {
+ msg := &MyMessage{
+ Count: Int32(42),
+ }
+ if err := SetExtension(msg, E_Greeting, []string{"bula", "hola"}); err != nil {
+ panic(err)
+ }
+ return UnmarshalTextTest{in: text, out: msg}
+}
+
var unMarshalTextTests = []UnmarshalTextTest{
// Basic
{
@@ -225,6 +235,7 @@
buildExtStructTest(`count: 42 [testdata.Ext.more]:<data:"Hello, world!" >`),
buildExtStructTest(`count: 42 [testdata.Ext.more] {data:"Hello, world!"}`),
buildExtDataTest(`count: 42 [testdata.Ext.text]:"Hello, world!" [testdata.Ext.number]:1729`),
+ buildExtRepStringTest(`count: 42 [testdata.greeting]:"bula" [testdata.greeting]:"hola"`),
// Big all-in-one
{