Repository navigation
test: cover HTTP 300 redirect assertion - #1997
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.
Summary
Add a regression test that
HTTPRedirectaccepts HTTP 300 Multiple Choices, the lower boundary of the 3xx status range.Changes
assert/http_assertions_test.go.Motivation
A one-character boundary change could make
HTTPRedirectreject HTTP 300 while all previous tests remain green. This test protects the first status in the redirect range, including the boolean result and reported assertion.The existing redirect tests check 307 as accepted and 101, 200, and 500 as rejected. In an isolated worktree, changing the lower-bound comparison from
>= 300to> 300leaves the entire unchanged suite green. The new test fails by assertion under that regression and passes with the current production code. This is test coverage only; it does not change behavior or fix a production bug.Verification
go test ./...— passed (Go 1.25 container)go vet ./...— passedgofmt -l assert/http_assertions_test.go— cleangit diff --check— passedSupertest 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.
Related issues
None linked; this test protects existing behavior.
Repository guidance
The description follows
.github/pull_request_template.mdand includes the motivation and change type requested byCONTRIBUTING.md. This is test coverage for existing behavior; no production behavior changes.