From ac5992b6c6114e5434986dd009321e340e0334c8 Mon Sep 17 00:00:00 2001 From: rcourtman Date: Sat, 29 Nov 2025 15:22:05 +0000 Subject: [PATCH] Add regression test for normalizeVersion Prevents recurrence of the infinite update loop bug fixed in 1b866598 where version prefix mismatch caused continuous self-updates. --- internal/agentupdate/update_test.go | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/internal/agentupdate/update_test.go b/internal/agentupdate/update_test.go index 078a285..840598b 100644 --- a/internal/agentupdate/update_test.go +++ b/internal/agentupdate/update_test.go @@ -396,3 +396,12 @@ func TestSymlinkResolution(t *testing.T) { } os.Remove(newPath) } + +func TestNormalizeVersion(t *testing.T) { + if got := normalizeVersion("v4.33.1"); got != "4.33.1" { + t.Errorf("normalizeVersion(%q) = %q, want %q", "v4.33.1", got, "4.33.1") + } + if got := normalizeVersion("4.33.1"); got != "4.33.1" { + t.Errorf("normalizeVersion(%q) = %q, want %q", "4.33.1", got, "4.33.1") + } +}