From 086b10b6d4780c9b512884b30dcb446795de6ea9 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 078a28529..840598b65 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") + } +}