internal/buildbinary: add additional testing
Add testing for findBinaries where a module has multiple "main"
packages.
Change-Id: Ied1d7dea0675b80d43edab94c843bdc0285a7fd9
Reviewed-on: https://go-review.googlesource.com/c/pkgsite-metrics/+/513935
Run-TryBot: Maceo Thompson <maceothompson@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: Jonathan Amsterdam <jba@google.com>
diff --git a/internal/buildbinary/bin_test.go b/internal/buildbinary/bin_test.go
index 354b177..1d9f8b3 100644
--- a/internal/buildbinary/bin_test.go
+++ b/internal/buildbinary/bin_test.go
@@ -34,6 +34,12 @@
want: []string{"golang.org/vuln"},
wantErr: false,
},
+ {
+ name: "multiple test",
+ dir: filepath.Join(localTestData, "multipleBinModule"),
+ want: []string{"example.com/test", "example.com/test/multipleBinModule", "example.com/test/p1"},
+ wantErr: false,
+ },
}
for _, tt := range tests {
t.Run(tt.name, func(t *testing.T) {