[优化] 重构升级处理逻辑,添加备份二进制文件移除功能,更新相关测试以验证新行为

This commit is contained in:
ryan
2026-05-30 16:05:48 +08:00
parent d619deec96
commit 3423175006
3 changed files with 93 additions and 18 deletions
@@ -0,0 +1,15 @@
//go:build !windows
package updater
import (
"path/filepath"
"testing"
)
func TestRemoveBackupBinaryIgnoresMissingFile(t *testing.T) {
backupPath := filepath.Join(t.TempDir(), "openflare-agent.bak")
if err := removeBackupBinary(backupPath); err != nil {
t.Fatalf("expected missing backup cleanup to be ignored: %v", err)
}
}