Check release validation counts without requiring order
This commit is contained in:
@@ -256,9 +256,15 @@ func TestCandidateCheckerSelectsOwnedValidationOnce(t *testing.T) {
|
||||
"off vet -mod=readonly ./...",
|
||||
"off build-release-assets v1.2.3",
|
||||
}
|
||||
for index, prefix := range want {
|
||||
if !strings.HasPrefix(lines[index], prefix) {
|
||||
t.Fatalf("owned command %d = %q, want prefix %q", index, lines[index], prefix)
|
||||
for _, prefix := range want {
|
||||
count := 0
|
||||
for _, line := range lines {
|
||||
if strings.HasPrefix(line, prefix) {
|
||||
count++
|
||||
}
|
||||
}
|
||||
if count != 1 {
|
||||
t.Fatalf("owned command %q ran %d times, want once: %q", prefix, count, lines)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user