starwing / lua-protobuf

A Lua module to work with Google protobuf
MIT License
1.75k stars 387 forks source link

encode an empty map bug. #63

Closed cuixin closed 6 years ago

cuixin commented 6 years ago

the test case is below:

message TestMap {
   map<string, int32> map = 1;
   map<string, int32> packed_map = 2 [packed=true];
   map<string, TestEmpty> msg_map = 3;

} ]]

local data3 = { map = {} } local data3_chunk = pb.encode("TestMap", data3) table_eq(pb.decode("TestMap", data3_chunk), { map = {}})