| 1 | // Copyright 2018 The Go Authors. All rights reserved. |
| 2 | // Use of this source code is governed by a BSD-style |
| 3 | // license that can be found in the LICENSE file. |
| 4 | |
| 5 | package copylock_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/copylock" |
| 13 | "golang.org/x/tools/internal/testfiles" |
| 14 | ) |
| 15 | |
| 16 | func Test(t *testing.T) { |
| 17 | testdata := analysistest.TestData() |
| 18 | analysistest.Run(t, testdata, copylock.Analyzer, "a", "typeparams", "issue67787", "unfortunate") |
| 19 | } |
| 20 | |
| 21 | func TestVersions22(t *testing.T) { |
| 22 | dir := testfiles.ExtractTxtarFileToTmp(t, filepath.Join(analysistest.TestData(), "src", "forstmt", "go22.txtar")) |
| 23 | analysistest.Run(t, dir, copylock.Analyzer, "golang.org/fake/forstmt") |
| 24 | } |
| 25 | |
| 26 | func TestVersions21(t *testing.T) { |
| 27 | dir := testfiles.ExtractTxtarFileToTmp(t, filepath.Join(analysistest.TestData(), "src", "forstmt", "go21.txtar")) |
| 28 | analysistest.Run(t, dir, copylock.Analyzer, "golang.org/fake/forstmt") |
| 29 | } |