Skip to content

test: cover uint slice Append through SliceValue - #531

Open
renanmpimentel wants to merge 1 commit into
spf13:masterfrom
renanmpimentel:test/uint-slice-append
Open

renanmpimentel wants to merge 1 commit into
spf13:masterfrom
renanmpimentel:test/uint-slice-append

Conversation

@renanmpimentel

@renanmpimentel renanmpimentel commented Oct 22, 2026 •

Copy link
Copy Markdown

Why this test matters

A future Append implementation 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.Append and GetSlice contract for uint slice flags. The existing uint slice tests cover parsing and Replace, but do not call Append or GetSlice through the public interface. The new test checks both the underlying []uint and the string representation after appending a hexadecimal value.

Regression proof

In an isolated worktree, removing the append to the underlying slice from uintSliceValue.Append leaves 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 ./... — passed
  • gofmt -l uint_slice_test.go — clean
  • git diff --check — passed

The 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, and gofmt passed. The CLA check remains pending; I cannot mark it complete.

@CLAassistant

Copy link
Copy Markdown

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.
You have signed the CLA already but the status is still pending? Let us recheck it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants