test/goroot: match malformed selector recovery - #2227
Conversation
There was a problem hiding this comment.
Review summary
Reviewed the authored changes in test/goroot/runner_test.go, test/goroot/runner_unit_test.go, and test/goroot/xfail.yaml (the libslirp0 CI change and merge commit in the range are pre-existing, not part of this PR's work).
This is a well-scoped test-infra change. The parser-recovery pairing is deliberately narrow — it keys on exact primary message, exact source shape (parserRecoverySourceCode), file, and line, with one-shot consumption — so every GOROOT ERROR stays mandatory and unrelated diagnostics can't be silently suppressed. The diagnosticPathResolver.resolve change actually tightens the previous behavior: an absolute path now has to identify a configured source before it resolves, closing a small over-permissive fallback. The physical/hasLineDirective gate correctly falls back to leaving all recovery diagnostics visible when a //line//*line*/ directive makes physical-line pairing ambiguous. The six removed xfail.yaml entries line up with the deterministic secondaries now handled by the pairing table.
Verification performed:
go vet ./test/goroot— clean.- Ran the new/pure unit tests (
TestParseDirective*,TestDiscoverCases*,TestRunProgramTimeout,TestRunGeneratedProgramUsesProvidedTimeout,TestValidateSystemMemoryState,TestShardCases, etc.) — all pass.
One minor, non-blocking observation is left inline. No correctness, security, or performance concerns found.
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
3ba8bda to
417af27
Compare
Depends on #2222.
Summary
g(f..3)source shape fromsyntax/ddd.gosyntax/ddd.goxfailThe regression coverage was added before the allowance and reproduced the failure. It includes wrong-source, missing-primary, and wrong-line counterexamples; shared tests already cover exact message multiplicity and
//linefail-open behavior.Validation
go test ./test/goroot -count=1syntax/ddd.gowith an empty xfail set on Go 1.24.11, 1.25.0, 1.26.0, and 1.26.5git diff --checkNo cross-line recovery allowance is introduced.