(t *testing.T)
| 3 | import "testing" |
| 4 | |
| 5 | func TestNormalizeFileForPackageMatch(t *testing.T) { |
| 6 | cases := map[string]struct { |
| 7 | in string |
| 8 | want string |
| 9 | }{ |
| 10 | "no version": { |
| 11 | in: "/home/me/src/goa/eval/error.go", |
| 12 | want: "/home/me/src/goa/eval/error.go", |
| 13 | }, |
| 14 | "module cache version": { |
| 15 | in: "/home/me/go/pkg/mod/goa.design/goa/v3@v3.23.2/dsl/result_type.go", |
| 16 | want: "/home/me/go/pkg/mod/goa.design/goa/v3/dsl/result_type.go", |
| 17 | }, |
| 18 | "multiple @ segments": { |
| 19 | in: "/home/me/go/pkg/mod/example.com/foo@v1.2.3/bar@v0.1.0/baz.go", |
| 20 | want: "/home/me/go/pkg/mod/example.com/foo/bar/baz.go", |
| 21 | }, |
| 22 | } |
| 23 | |
| 24 | for name, tc := range cases { |
| 25 | t.Run(name, func(t *testing.T) { |
| 26 | got := normalizeFileForPackageMatch(tc.in) |
| 27 | if got != tc.want { |
| 28 | t.Errorf("got %q, want %q", got, tc.want) |
| 29 | } |
| 30 | }) |
| 31 | } |
| 32 | } |
nothing calls this directly
no test coverage detected