test: regression tests for vlang/v#26644 and vlang/msgpack#12#15
Merged
Conversation
Pins the exact reproductions from each bug report so future regressions fail loudly with a direct link back to the original issue. Covers all three bugs from vlang/v#26644 (minimal int encoding, signed-vs-unsigned boundary 128-255, fixint decoding) and both forms of the #12 struct-decode panic — the direct encode/decode round-trip and the json.decode -> msgpack.encode -> msgpack.decode pipeline the reporter used. The struct test also feeds in the pre-fix wire bytes from the bug report to ensure the decode bug isn't being masked by the new encoder picking a more compact format.
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.
Summary
Adds
issues_test.vcapturing the exact reproductions from each bug report that motivated the recent #13 and #14 fixes, so future regressions fail loudly with a direct link back to the original issue.Covers:
encode(0),encode(42),encode(127),encode(-1),encode(-32),encode(-123),encode([0]),encode([1,2,3])against the spec-mandated minimal bytes.positive_int_unsigneddefaulted false. Tests the 128–255 boundary (encode(128),encode(200),encode(255)) produces 2-byte uint8, not 3-byte int16.decode([0x00]),[0x2a],[0x7f],[0xe0],[0xfb],[0xff]produce the expected ints.json.decode → msgpack.encode → msgpack.decodepipeline from the reporter's code. Also feeds in the pre-fix wire bytes from the report to make sure the decode bug isn't masked by the encoder now picking a more compact format.Test plan
v test .— all 4 test files pass (encode, decode, decode_to_json, issues)v fmt -verify issues_test.v— clean