fix: TestEnsureProviders using the wrong line breaks and PackageDir separator (#3273)

Signed-off-by: Diogenes Fernandes <diofeher@gmail.com>
This commit is contained in:
Diógenes Fernandes
2025-09-16 13:27:35 -03:00
committed by GitHub
parent d280ab1d6b
commit f5ef40c37c
2 changed files with 5 additions and 3 deletions

1
.gitattributes vendored
View File

@@ -2,3 +2,4 @@ internal/**/*.tf text eol=lf
internal/**/*.tofu text eol=lf
internal/**/*.json text eol=lf
internal/**/*.tmpl text eol=lf
internal/providercache/testdata/**/* text eol=lf

View File

@@ -1037,7 +1037,7 @@ func TestEnsureProviderVersions(t *testing.T) {
LocalDir string
}{
"2.1.0",
filepath.Join(dir.BasePath(), "example.com/foo/beep/2.1.0/bleep_bloop"),
filepath.ToSlash(filepath.Join(dir.BasePath(), "example.com/foo/beep/2.1.0/bleep_bloop")),
},
},
},
@@ -1109,10 +1109,11 @@ func TestEnsureProviderVersions(t *testing.T) {
}
gotEntry := dir.ProviderLatestVersion(beepProvider)
wantEntry := &CachedProvider{
Provider: beepProvider,
Version: getproviders.MustParseVersion("2.1.0"),
PackageDir: filepath.Join(dir.BasePath(), "example.com/foo/beep/2.1.0/bleep_bloop"),
PackageDir: filepath.ToSlash(filepath.Join(dir.BasePath(), "example.com/foo/beep/2.1.0/bleep_bloop")),
}
if diff := cmp.Diff(wantEntry, gotEntry); diff != "" {
t.Errorf("wrong cache entry\n%s", diff)