From e08f083ec8cd5a768a5fce9c8c907c848efc64ec Mon Sep 17 00:00:00 2001 From: Eric Rakestraw Date: Mon, 28 Sep 2026 02:26:45 +0000 Subject: [PATCH] Check release validation counts without requiring order --- internal/releasecheck/assets_test.go | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/internal/releasecheck/assets_test.go b/internal/releasecheck/assets_test.go index 716d3d7..ec4445c 100644 --- a/internal/releasecheck/assets_test.go +++ b/internal/releasecheck/assets_test.go @@ -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) } } }