x/tools/go/analysis/analysistest: analysistest.RunWithSuggestedFixes doesn't fail when a golden file is provided without suggested fixes #71130
Labels
Tools
This label describes issues relating to any tools in the x/tools repository.
Milestone
Go version
go version go1.23.4 linux/amd64
Output of
go env
in your module/workspace:What did you do?
In the following example, the suggested fixes are not created for all reports (this is expected).
The golden files and the sources are different.
The Analyzer implementation should be considered as bugged:
i == 0
should bei == 1
.When you run the test (
analysistest.RunWithSuggestedFixes
), it doesn't fail because the golden file is only checked if there are suggested fixes.This hides the bug inside the Analyzer implementation.
main.go
main_test.go
testdata/src/foo/foo.go
testdata/src/foo/foo.go.golden
What did you see happen?
The test doesn't fail.
What did you expect to see?
A failure of the test.
The text was updated successfully, but these errors were encountered: