- 删除通用 desktop target,重命名 platform targets 为简短形式 (desktop-mac/win/linux)
- 构建产物文件名统一为 nex-{os}-{arch}[.exe] 格式
- Windows 托盘图标使用 .ico 格式(运行时按平台选择)
- Windows 原生对话框使用 user32.MessageBoxW 替代 msg * 命令
- 更新 README.md 和 package-macos.sh 中的引用
- 添加单元测试覆盖 MessageBoxW 封装和图标选择逻辑
- 同步更新 desktop-app spec 规范文档
34 lines
694 B
Go
34 lines
694 B
Go
package main
|
|
|
|
import (
|
|
"runtime"
|
|
"testing"
|
|
|
|
"nex/embedfs"
|
|
)
|
|
|
|
func TestIconSelection_Windows(t *testing.T) {
|
|
if runtime.GOOS != "windows" {
|
|
t.Skip("图标格式选择测试仅在 Windows 上运行")
|
|
}
|
|
|
|
if err := testIconLoad("assets/icon.ico"); err != nil {
|
|
t.Fatalf("Windows 应加载 .ico 文件: %v", err)
|
|
}
|
|
}
|
|
|
|
func TestIconSelection_NonWindows(t *testing.T) {
|
|
if runtime.GOOS == "windows" {
|
|
t.Skip("图标格式选择测试在非 Windows 平台运行")
|
|
}
|
|
|
|
if err := testIconLoad("assets/icon.png"); err != nil {
|
|
t.Fatalf("非 Windows 平台应加载 .png 文件: %v", err)
|
|
}
|
|
}
|
|
|
|
func testIconLoad(path string) error {
|
|
_, err := embedfs.Assets.ReadFile(path)
|
|
return err
|
|
}
|