starwing / lua-protobuf

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

make pb.type() return information about empty messages #68

Closed edam closed 6 years ago

coveralls commented 6 years ago

Pull Request Test Coverage Report for Build 105


Totals Coverage Status
Change from base Build 104: 7.0e-05%
Covered Lines: 1653
Relevant Lines: 1655

💛 - Coveralls
coveralls commented 6 years ago

Pull Request Test Coverage Report for Build 105


Totals Coverage Status
Change from base Build 104: 7.0e-05%
Covered Lines: 1653
Relevant Lines: 1655

💛 - Coveralls
coveralls commented 6 years ago

Pull Request Test Coverage Report for Build 108


Totals Coverage Status
Change from base Build 107: 0.0%
Covered Lines: 1650
Relevant Lines: 1652

💛 - Coveralls
coveralls commented 6 years ago

Pull Request Test Coverage Report for Build 105


Totals Coverage Status
Change from base Build 104: 7.0e-05%
Covered Lines: 1653
Relevant Lines: 1655

💛 - Coveralls
starwing commented 6 years ago

@edam Thansk for contribution! But maybe you should test the t->is_dead field?

In short, if you delete a type, I will not delete it directly, but just clear it. That's why we do not show the empty message: they may be the deleted message, but not only empty messages.

So I added a flag is_dead before to detect whether the type is deleted or just a truly empty message. You should test this message instead.

edam commented 6 years ago

@starwing how's that?