package utils import "testing" func TestIsNewerVersion(t *testing.T) { tests := []struct { name string remote string local string expected bool }{ { name: "newer version available", remote: "v0.2.0", local: "v0.1.0", expected: true, }, { name: "same version", remote: "v0.1.0", local: "v0.1.0", expected: false, }, { name: "local is newer", remote: "v0.1.0", local: "v0.2.0", expected: false, }, { name: "without v prefix", remote: "0.2.0", local: "0.1.0", expected: true, }, { name: "mixed prefix", remote: "v0.2.0", local: "0.1.0", expected: true, }, } for _, tt := range tests { t.Run(tt.name, func(t *testing.T) { result := isNewerVersion(tt.remote, tt.local) if result != tt.expected { t.Errorf("isNewerVersion(%s, %s) = %v, expected %v", tt.remote, tt.local, result, tt.expected) } }) } }