Skip to content

Commit e74a7fd

Browse files
committed
test: include groups when describing package details
1 parent d571f9f commit e74a7fd

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

pkg/lockfile/helpers_test.go

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,13 @@ func packageToString(pkg lockfile.PackageDetails) string {
4242
commit = "<no commit>"
4343
}
4444

45-
return fmt.Sprintf("%s@%s (%s, %s)", pkg.Name, pkg.Version, pkg.Ecosystem, commit)
45+
groups := strings.Join(pkg.DepGroups, ", ")
46+
47+
if groups == "" {
48+
groups = "<no groups>"
49+
}
50+
51+
return fmt.Sprintf("%s@%s (%s, %s, %s)", pkg.Name, pkg.Version, pkg.Ecosystem, commit, groups)
4652
}
4753

4854
func hasPackage(t *testing.T, packages []lockfile.PackageDetails, pkg lockfile.PackageDetails) bool {

0 commit comments

Comments
 (0)