Skip to content

Commit

Permalink
go/analysis: enable a test that applies after go list behavior change
Browse files Browse the repository at this point in the history
The despite-error case in TestRunDespiteErrors only returns error code 1
after golang.org/cl/437298. This CL enables the test for Go 1.20+.

Change-Id: Ib212026d595e7bf872aa2482e1d91723010e7018
Reviewed-on: https://go-review.googlesource.com/c/tools/+/441880
Run-TryBot: Michael Matloob <[email protected]>
Reviewed-by: David Chase <[email protected]>
TryBot-Result: Gopher Robot <[email protected]>
Reviewed-by: Alan Donovan <[email protected]>
gopls-CI: kokoro <[email protected]>
  • Loading branch information
matloob committed Oct 19, 2022
1 parent b50d7ba commit 9eda97b
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion go/analysis/internal/checker/checker_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,8 @@ func Foo(s string) int {
// no errors
{name: "no-errors", pattern: []string{"sort"}, analyzers: []*analysis.Analyzer{analyzer, noop}, code: 0},
} {
if test.name == "despite-error" { // TODO(matloob): once CL 437298 is submitted, add the condition testenv.Go1Point() < 20
if test.name == "despite-error" && testenv.Go1Point() < 20 {
// The behavior in the comment on the despite-error test only occurs for Go 1.20+.
continue
}
if got := checker.Run(test.pattern, test.analyzers); got != test.code {
Expand Down

0 comments on commit 9eda97b

Please sign in to comment.