Consolidate request validation parity assertions

This commit is contained in:
2026-10-12 19:31:54 +00:00
parent 18309f50db
commit 50bc35516a
2 changed files with 17 additions and 33 deletions

View File

@@ -5,9 +5,10 @@ Reviewed commits `f315620`, `f3148bf`, and `60784e7` against the finalized
## 1. Reuse The Existing Preparation-Parity Test Helper
Priority: P3 (test maintainability). Status: open.
Priority: P3 (test maintainability). Status: complete.
In [validate_request_contract_test.go](../../validate_request_contract_test.go),
At reviewed commit `60784e7`, in
[validate_request_contract_test.go](../../validate_request_contract_test.go),
`TestValidateRequestMatchesPrepareContract` defines a local `testParity` closure
at lines 25–45 that duplicates the package-level
`assertValidateRequestParity` helper at lines 87–108. Both invoke `Prepare` and
@@ -31,6 +32,16 @@ This is a small cleanup, not a demonstrated functional or release-blocking bug.
Verify with `go test -race . -run '^TestValidateRequest'` and
`git diff --check`, formatting the changed Go file.
### Completion
Removed the local closure and reused `assertValidateRequestParity` for all four
cases, including the nil-engine `ErrInvalidConfig` expectation. Existing cases,
public-error assertions, and no-model-call checks are preserved; production code
and public contracts are unchanged.
Formatted the Go file. The uncached, race-enabled `TestValidateRequest` tests
and `git diff --check` passed.
## Review Outcome
The public method and shared facade helper match the intended architecture.