Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

The testing practice I've seen is to have a testdata/ directory with a bunch of textprotos for different test cases. If you're using Bazel, just include the entire directory glob as data dependency for the unit tests. The test tables are essentially just appropriately named textproto filenames that are unmarshaled into the proto message to be tested.

Then again I've also seen people do these thousand line in-code literal string protos which really grind my gears.



Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: