Fixed parsing for string->double maps. (#243)
Map parsing/serializing relies on map entries always having a predictable order. The code that generates layout was not respecting this in the case of string keys and primitive values.pull/13171/head
parent
ce1a399a19
commit
ca512852f3
8 changed files with 120 additions and 73 deletions
@ -0,0 +1,7 @@ |
||||
syntax = "proto2"; |
||||
|
||||
package lua_test; |
||||
|
||||
message TestLua { |
||||
map<string, double> map_string_double = 1; |
||||
} |
@ -1,68 +1,8 @@ |
||||
|
||||
// A series of messages with various kinds of cycles in them. |
||||
// +-+---+ +---+ +---+ |
||||
// V | | V | V | |
||||
// A -> B-+-> C -> D---+--->E---+ |
||||
// ^ |`---|--------^ |
||||
// +----------+----+ F |
||||
|
||||
syntax = "proto2"; |
||||
|
||||
message A { |
||||
optional B b = 1; |
||||
} |
||||
|
||||
message B { |
||||
optional B b = 1; |
||||
optional C c = 2; |
||||
} |
||||
|
||||
message C { |
||||
optional A a = 1; |
||||
optional B b = 2; |
||||
optional D d = 3; |
||||
optional E e = 4; |
||||
} |
||||
|
||||
message D { |
||||
optional A a = 1; |
||||
optional D d = 2; |
||||
optional E e = 3; |
||||
} |
||||
|
||||
message E { |
||||
optional E e = 1; |
||||
} |
||||
|
||||
message F { |
||||
optional E e = 1; |
||||
} |
||||
|
||||
// A proto with a bunch of simple primitives. |
||||
message SimplePrimitives { |
||||
optional fixed64 u64 = 1; |
||||
optional fixed32 u32 = 2; |
||||
optional double dbl = 3; |
||||
optional float flt = 5; |
||||
optional sint64 i64 = 6; |
||||
optional sint32 i32 = 7; |
||||
optional bool b = 8; |
||||
optional string str = 9; |
||||
|
||||
oneof foo { |
||||
int32 oneof_int32 = 10; |
||||
string oneof_string = 11; |
||||
} |
||||
|
||||
oneof bar { |
||||
int64 oneof_int64 = 13; |
||||
bytes oneof_bytes = 14; |
||||
} |
||||
package upb_test; |
||||
|
||||
message Nested { |
||||
oneof foo { |
||||
int32 oneof_int32 = 10; |
||||
string b = 11; |
||||
} |
||||
} |
||||
message MapTest { |
||||
map<string, double> map_string_double = 1; |
||||
} |
||||
|
Loading…
Reference in new issue