My question is, how can I avoid typing out large struct literals in tests for functionality of the sort found in these parsers?
I had the idea of deriving serialization behavior using serde_json for the relevant structs and then testing against an expected serialization. That way, I thought the representation of the desired output might be easier to visually parse in certain cases and it would be easier to figure out why tests are breaking if I did a line diff of conflicting serializations. But this approach feels kinda hacky and it seems to assume that serialzation will always happen in a consistent way which may not be the case.