...
1
2
3
4
5 package loopclosure_test
6
7 import (
8 "path/filepath"
9 "testing"
10
11 "golang.org/x/tools/go/analysis/analysistest"
12 "golang.org/x/tools/go/analysis/passes/loopclosure"
13 "golang.org/x/tools/internal/testenv"
14 "golang.org/x/tools/internal/testfiles"
15 )
16
17 func Test(t *testing.T) {
18
19 testenv.SkipAfterGo1Point(t, 21)
20
21 testdata := analysistest.TestData()
22 analysistest.Run(t, testdata, loopclosure.Analyzer,
23 "a", "golang.org/...", "subtests", "typeparams")
24 }
25
26 func TestVersions22(t *testing.T) {
27 testenv.NeedsGo1Point(t, 22)
28
29 txtar := filepath.Join(analysistest.TestData(), "src", "versions", "go22.txtar")
30 dir := testfiles.ExtractTxtarToTmp(t, txtar)
31 analysistest.Run(t, dir, loopclosure.Analyzer, "golang.org/fake/versions")
32 }
33
34 func TestVersions18(t *testing.T) {
35 txtar := filepath.Join(analysistest.TestData(), "src", "versions", "go18.txtar")
36 dir := testfiles.ExtractTxtarToTmp(t, txtar)
37 analysistest.Run(t, dir, loopclosure.Analyzer, "golang.org/fake/versions")
38 }
39
View as plain text