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 vet -mod=readonly ./...",
|
||||||
"off build-release-assets v1.2.3",
|
"off build-release-assets v1.2.3",
|
||||||
}
|
}
|
||||||
for index, prefix := range want {
|
for _, prefix := range want {
|
||||||
if !strings.HasPrefix(lines[index], prefix) {
|
count := 0
|
||||||
t.Fatalf("owned command %d = %q, want prefix %q", index, lines[index], prefix)
|
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