Repository navigation
test: pin variant literal set edge cases - #2139
Merged
laskoviymishka merged 1 commit intoOct 7, 2026
Merged
Conversation
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.
Follow-up to #2097, addressing the nits
Changes
literal_set_internal_test.go): adds a case with two distinct variants whose metadata and value bytes concatenate to the same sequence, using @zeroshade's example (metadata accepts trailing bytes).addliteraloverwrites on a key match without callingEquals, so the length prefix invariantKeyis what keeps both members. Previously no test failed if the prefix was removed; this one does (1 member instead of 2).variantKeycomment (utils.go): states that it must hash exactly whatVariantLiteral.Equalscompares, why the length prefix matters for correctness, and that a genuine 64-bit collision still drops the earlier member, as for Binary, Fixed, and Geo.exprs_test.go): nowbind to variant column keeps distinct members, and theErrTypeassertion stays. With two distinct values,ErrTypeis only reachable if the bind-time set still holds both. If they collapsed to one, binding would take the single-literal path and fail withErrInvalidArgument(I checked this).buildclosures captured the parentt, so a failure inside a subtest producedsubtest may have called FailNow on a parent test. They now use helpers that take the subtest'st: the existingvariantLiteralOf, and a small wrapper over the existingscalarVariant.Validation
gofmt,go vet ., andgo test -race .pass.