proto: update the library to be in sync with Google's internal code.
R=rsc
CC=golang-dev
http://codereview.appspot.com/1158043
diff --git a/proto/text_parser_test.go b/proto/text_parser_test.go
index 7017dc0..96ec965 100644
--- a/proto/text_parser_test.go
+++ b/proto/text_parser_test.go
@@ -50,7 +50,7 @@
in: " count:42\n name:\"Dave\" ",
out: &MyMessage{
Count: Int32(42),
- Name: String("Dave"),
+ Name: String("Dave"),
},
},
@@ -59,7 +59,7 @@
in: `count:42 name:""`,
out: &MyMessage{
Count: Int32(42),
- Name: String(""),
+ Name: String(""),
},
},
@@ -68,49 +68,49 @@
in: `count:42 name: "My name is "` + "\n" + `"elsewhere"`,
out: &MyMessage{
Count: Int32(42),
- Name: String("My name is elsewhere"),
+ Name: String("My name is elsewhere"),
},
},
// Bad quoted string
UnmarshalTextTest{
- in: `inner: < host: "\0" >` + "\n",
+ in: `inner: < host: "\0" >` + "\n",
error: `line 1.15: invalid quoted string "\0"`,
},
// Number too large for int64
UnmarshalTextTest{
- in: "count: 123456789012345678901",
+ in: "count: 123456789012345678901",
error: "line 1.7: invalid int32: 123456789012345678901",
},
// Number too large for int32
UnmarshalTextTest{
- in: "count: 1234567890123",
+ in: "count: 1234567890123",
error: "line 1.7: invalid int32: 1234567890123",
},
// Number too large for float32
UnmarshalTextTest{
- in: "others:< weight: 12345678901234567890123456789012345678901234567890 >",
+ in: "others:< weight: 12345678901234567890123456789012345678901234567890 >",
error: "line 1.17: invalid float32: 12345678901234567890123456789012345678901234567890",
},
// Number posing as a quoted string
UnmarshalTextTest{
- in: `inner: < host: 12 >` + "\n",
+ in: `inner: < host: 12 >` + "\n",
error: `line 1.15: invalid string: 12`,
},
// Quoted string posing as int32
UnmarshalTextTest{
- in: `count: "12"`,
+ in: `count: "12"`,
error: `line 1.7: invalid int32: "12"`,
},
// Quoted string posing a float32
UnmarshalTextTest{
- in: `others:< weight: "17.4" >`,
+ in: `others:< weight: "17.4" >`,
error: `line 1.17: invalid float32: "17.4"`,
},
@@ -118,7 +118,7 @@
UnmarshalTextTest{
in: `count:42 bikeshed: BLUE`,
out: &MyMessage{
- Count: Int32(42),
+ Count: Int32(42),
Bikeshed: NewMyMessage_Color(MyMessage_BLUE),
},
},
@@ -128,7 +128,7 @@
in: `count:42 pet: "horsey" pet:"bunny"`,
out: &MyMessage{
Count: Int32(42),
- Pet: []string{"horsey", "bunny"},
+ Pet: []string{"horsey", "bunny"},
},
},
@@ -145,25 +145,25 @@
// Missing colon for string field
UnmarshalTextTest{
- in: `name "Dave"`,
+ in: `name "Dave"`,
error: `line 1.5: expected ':', found "\"Dave\""`,
},
// Missing colon for int32 field
UnmarshalTextTest{
- in: `count 42`,
+ in: `count 42`,
error: `line 1.6: expected ':', found "42"`,
},
// Missing required field
UnmarshalTextTest{
- in: ``,
+ in: ``,
error: `line 1.0: message test_proto.MyMessage missing required field "count"`,
},
// Repeated non-repeated field
UnmarshalTextTest{
- in: `name: "Rob" name: "Russ"`,
+ in: `name: "Rob" name: "Russ"`,
error: `line 1.12: non-repeated field "name" was repeated`,
},
@@ -193,17 +193,17 @@
`>`,
out: &MyMessage{
Count: Int32(42),
- Name: String("Dave"),
+ Name: String("Dave"),
Quote: String(`"I didn't want to go."`),
- Pet: []string{"bunny", "kitty", "horsey"},
+ Pet: []string{"bunny", "kitty", "horsey"},
Inner: &InnerMessage{
- Host: String("footrest.syd"),
- Port: Int32(7001),
+ Host: String("footrest.syd"),
+ Port: Int32(7001),
Connected: Bool(true),
},
Others: []*OtherMessage{
&OtherMessage{
- Key: Int64(3735928559),
+ Key: Int64(3735928559),
Value: []byte{0x1, 'A', '\a', '\f'},
},
&OtherMessage{