Skip to content

Commit

Permalink
Test apiviewgo review names for v2 module (#8933)
Browse files Browse the repository at this point in the history
  • Loading branch information
chlowell authored Sep 6, 2024
1 parent cfc4c9f commit 39dacb7
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 0 deletions.
9 changes: 9 additions & 0 deletions src/go/cmd/api_view_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -290,6 +290,15 @@ func TestAliasDiagnostics(t *testing.T) {
}
}

func TestMajorVersion(t *testing.T) {
review, err := createReview(filepath.Clean("testdata/test_major_version"))
require.NoError(t, err)
require.Equal(t, "Go", review.Language)
require.Equal(t, "test_major_version", review.Name)
require.Equal(t, 1, len(review.Navigation))
require.Equal(t, "test_major_version/subpackage", review.Navigation[0].Text)
}

func TestVars(t *testing.T) {
review, err := createReview(filepath.Clean("testdata/test_vars"))
require.NoError(t, err)
Expand Down
6 changes: 6 additions & 0 deletions src/go/cmd/pkg_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,12 @@ func TestName(t *testing.T) {
for _, test := range []struct {
modulePath, moduleRoot, pkgPath, want string
}{
{
modulePath: "test_major_version/v2",
moduleRoot: "testdata/test_major_version",
pkgPath: "subpackage",
want: "test_major_version/subpackage",
},
{
modulePath: "test_package_name",
moduleRoot: "testdata/test_package_name/[email protected]",
Expand Down
3 changes: 3 additions & 0 deletions src/go/cmd/testdata/test_major_version/go.mod
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
module test_major_version/v2

go 1.18
3 changes: 3 additions & 0 deletions src/go/cmd/testdata/test_major_version/subpackage/test.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
package subpackage

type S string

0 comments on commit 39dacb7

Please sign in to comment.