Repository navigation
test(codegen): hold the field order to the lowest tag - #71
Merged
Merged
Conversation
fields_are_encoded_in_tag_order passed with the sort removed, because its fixture declared the fields in tag order. The fixture now declares them out of order, with a oneof that lists its highest tag first, so the declaration order, a sort by a oneof's first tag and the wire order are three different orders. A second test holds Debug to the declaration order. Signed-off-by: Jonasz Małecki <[email protected]>
The proto update steps said a new field needs nothing beyond codegen. The samples in sdk/tests/generated_messages.rs list every field of a message, so that file stops compiling until the new field is set there. Say so as a step of its own. Signed-off-by: Jonasz Małecki <[email protected]>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This follows up on the review of #70.
fields_are_encoded_in_tag_orderincodegen/src/messages.rspassed with the sort removed, because its fixture already declared the fields in tag order. The fixture now declares them out of order with a oneof that lists its highest tag first, and a second test covers the orderDebugprints them in. With the sort removed, with a sort by a oneof's first tag, and withDebugin tag order, one of the two tests fails each time.CONTRIBUTING.mdsaid a new proto field doesn't need anything beyondcargo run -p codegen. The samples insdk/tests/generated_messages.rslist every field of a message and stop compiling until someone sets the new one, so that's now a step of its own, and the generated files don't change.