starwing / lua-protobuf

A Lua module to work with Google protobuf
MIT License
1.71k stars 388 forks source link

pb.option "enum_as_value" - value is always zero #230

Closed alonbg closed 1 year ago

alonbg commented 1 year ago

runtime: luajit-openresty/bin/luajit release LuaJIT 2.1.0-beta3

commit 762b027 test.lua:L367 latest as of this writing

pb.option "enum_as_value" 

test will fails for enum values mapped to numbers other than 0. but it passes as [only] 0 is being asserted :)

starwing commented 1 year ago

this is cause by the test itself. It just test pb.defaults which gets the default value of all field. and the default value of color is 0. It's not the test for pb.decode

alonbg commented 1 year ago

makes sense. thanks @starwing