Check release validation counts without requiring order

This commit is contained in:
2026-09-28 02:26:45 +00:00
parent 9bbec2fe79
commit e08f083ec8

View File

@@ -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)
}
}
}