From d3b64514725714556ad2d619eac95407eb92a914 Mon Sep 17 00:00:00 2001 From: Petr Date: Tue, 30 Jun 2026 11:32:09 +0200 Subject: [PATCH] test(gopher): assert orphan metadata is cleaned up --- internal/protocol/gopher/gopher_test.go | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/internal/protocol/gopher/gopher_test.go b/internal/protocol/gopher/gopher_test.go index 92d4dae..3167333 100644 --- a/internal/protocol/gopher/gopher_test.go +++ b/internal/protocol/gopher/gopher_test.go @@ -437,6 +437,12 @@ func TestGopherResumeStaleMetadata(t *testing.T) { if string(data) != "Fresh\n" { t.Errorf("content = %q, want %q", string(data), "Fresh\n") } + // The orphan sidecar from a different URL must be removed once the + // successful fresh download completes — otherwise stale metadata + // could be picked up by a future --resume run. + if output.FileExists(outPath + output.ResumeMetaFileSuffix) { + t.Error("expected orphan .goget.meta to be deleted after fresh download") + } } // TestGopherResumeIgnoredWhenWriterSet verifies that --resume is silently