- 删除通用 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 规范文档
31 lines
630 B
Go
31 lines
630 B
Go
package main
|
|
|
|
import (
|
|
"runtime"
|
|
"testing"
|
|
)
|
|
|
|
func TestMessageBoxW_WindowsOnly(t *testing.T) {
|
|
if runtime.GOOS != "windows" {
|
|
t.Skip("MessageBoxW 仅在 Windows 上测试")
|
|
}
|
|
|
|
messageBox("测试标题", "测试消息", MB_ICONINFORMATION)
|
|
}
|
|
|
|
func TestShowError_WindowsBranch(t *testing.T) {
|
|
if runtime.GOOS != "windows" {
|
|
t.Skip("Windows 原生对话框测试仅在 Windows 上运行")
|
|
}
|
|
|
|
showError("测试错误", "这是一条测试错误消息")
|
|
}
|
|
|
|
func TestShowAbout_WindowsBranch(t *testing.T) {
|
|
if runtime.GOOS != "windows" {
|
|
t.Skip("Windows 原生对话框测试仅在 Windows 上运行")
|
|
}
|
|
|
|
showAbout()
|
|
}
|