Repository navigation
test: cover uint slice Append through SliceValue - #531
Open
renanmpimentel wants to merge 1 commit into
Open
renanmpimentel wants to merge 1 commit into
renanmpimentel wants to merge 1 commit into
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.
Why this test matters
A future
Appendimplementation could return success without updating the underlying uint slice. The new public-interface test detects the lost flag value and also checks its string representation.Supertest audit method
I used the Supertest test-audit skill to probe whether the existing suite would catch a plausible violation of this contract. The regression was applied only in an isolated worktree. The regression proof records three executed states: the existing tests pass with that regression, the new assertion fails against the same regression, and the new test passes with the original production code restored. The published diff adds tests only.
Change and verification
Summary
Exercise the
SliceValue.AppendandGetSlicecontract for uint slice flags. The existing uint slice tests cover parsing andReplace, but do not callAppendorGetSlicethrough the public interface. The new test checks both the underlying[]uintand the string representation after appending a hexadecimal value.Regression proof
In an isolated worktree, removing the append to the underlying slice from
uintSliceValue.Appendleaves the unchanged suite green (go test ./...). With this test added, the same regression fails by assertion: the underlying slice remains[0 1]instead of[0 1 16]. Restoring production code makes the full suite pass.Verification
go test ./...— passed (Go 1.25 container)go vet ./...— passedgofmt -l uint_slice_test.go— cleangit diff --check— passedThe permanent diff changes only
uint_slice_test.go.Repository guidance
No contribution guide or PR template was present in the audited checkout.
go test,go vet, andgofmtpassed. The CLA check remains pending; I cannot mark it complete.