test/goroot: match vareq recovery diagnostics - #2230
Open
cpunion wants to merge 7 commits into
Open
Conversation
Contributor
There was a problem hiding this comment.
Review summary
Test-harness-only change scoping parser-recovery diagnostic pairing for the GOROOT errorcheck runner (test/goroot/runner_test.go, runner_unit_test.go, xfail.yaml). Reviewed for correctness, security, performance, and documentation accuracy across all four dimensions.
No blocking issues found. The change is well-structured and unusually well-tested — the fail-open behavior, one-use group consumption, physical-source gating, and line-directive detection each have targeted unit coverage.
Verified as correct (no action needed):
parserRecoverySourceCodehandles// GC_ERRORAUTOcorrectly via the// GC_ERRORprefix (runner_test.go:1763).hasLineDirectiveline-vs-block asymmetry (column-0//linevs inline/*line) matches Go's directive semantics (runner_test.go:1778).parserRecoveryAuthorizedcorrectly limits one source to one recovery group per matched ERROR (runner_test.go:1179).physicalDiagnosticSourcesaggregation (physical = previous && physical) is conservatively correct for repeated files (runner_test.go:1140).diagnosticPathResolver.resolverejects ambiguous short paths and unknown absolute paths (runner_test.go:1641).xfail.yamlreason removals correspond to cases now handled (bug050, vareq1, bug228, chan1, issue11610, vareq).
Minor (optional) observation:
test/goroot/runner_test.go:1739— inparserRecoverySecondaryGroups,parserRecoverySourceCode(source)runs again here even though the precedingparserRecoverySourceSecondaries(primary, source)call already normalizes internally (:1696). It's idempotent, so there's no correctness impact; normalizing once up front (and passing the cleaned value down) would remove the double work and make the data flow clearer. Non-blocking.
cpunion
force-pushed
the
codex/xfail-small-audit-20260730
branch
from
July 30, 2026 04:37
726e411 to
27c5a38
Compare
38 tasks
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.
Depends on #2222.
This narrowly scopes the extra parser-recovery diagnostics emitted for
test/syntax/vareq.goto its exact primary diagnostic, source line, and location. Independent one-use groups preserve unrelated same-line diagnostics and do not consume duplicate follow-ons more than once.Validation:
go test ./test/goroot -run "TestCheckExpectedErrorsScopesVareqRecovery|TestAdditionalParserRecoveryDiagnosticsFailOpen" -count=1go test ./test/goroot -count=1test/syntax/vareq.gowith Go 1.24.11, 1.25.0, 1.26.0, and 1.26.5git diff --check