diff options
Diffstat (limited to 'internal/postgres/details_test.go')
| -rw-r--r-- | internal/postgres/details_test.go | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/internal/postgres/details_test.go b/internal/postgres/details_test.go index 53f55dd2..b2d83d66 100644 --- a/internal/postgres/details_test.go +++ b/internal/postgres/details_test.go @@ -180,6 +180,11 @@ func TestPostgres_GetModuleInfo(t *testing.T) { }, } + latestGoodVersions := map[string]string{ + "mod.1": "v1.1.0", + "mod.2": "v1.1.0", + } + for _, test := range testCases { t.Run(test.name, func(t *testing.T) { for _, v := range test.modules { @@ -200,7 +205,11 @@ func TestPostgres_GetModuleInfo(t *testing.T) { t.Fatal("wantIndex too large") } wantVI := &test.modules[test.wantIndex].ModuleInfo - if diff := cmp.Diff(wantVI, gotVI, cmpopts.EquateEmpty(), cmp.AllowUnexported(source.Info{})); diff != "" { + wantVI.LatestVersion = latestGoodVersions[wantVI.ModulePath] + if diff := cmp.Diff(wantVI, gotVI, + cmpopts.EquateEmpty(), + cmp.AllowUnexported(source.Info{}), + ); diff != "" { t.Errorf("mismatch (-want +got):\n%s", diff) } }) |
