Skip to content

Commit

Permalink
test: import package with same prefix name
Browse files Browse the repository at this point in the history
  • Loading branch information
leovct committed Nov 29, 2024
1 parent 66987d9 commit 1a324dc
Showing 1 changed file with 11 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -600,6 +600,17 @@ func TestGetAbsoluteLocator_AbsoluteLocatorIsInRootPackageButSourceIsNotShouldNo
require.Nil(t, err)
}

func TestGetAbsoluteLocator_RepositoriesWithSamePrefixNameShouldNotBeBlocked(t *testing.T) {
provider := NewGitPackageContentProvider("", "", NewGitHubPackageAuthProvider(""), nil)

packageId := "github.com/package"
locatorOfModuleInWhichThisBuiltInIsBeingCalled := "github.com/package-2/main.star"
maybeRelativeLocator := "github.com/package/file.star"

_, err := provider.GetAbsoluteLocator(packageId, locatorOfModuleInWhichThisBuiltInIsBeingCalled, maybeRelativeLocator, noPackageReplaceOptions)
require.Nil(t, err)
}

func Test_isSamePackageLocalAbsoluteLocator_TestDetectionInSubpath(t *testing.T) {
result := shouldBlockAbsoluteLocatorBecauseIsInTheSameSourceModuleLocatorPackage("github.com/author/package/bang/lib.star", "github.com/author/package/main.star", "github.com/author/package/")
require.True(t, result)
Expand Down

0 comments on commit 1a324dc

Please sign in to comment.