1
0
Files
nex/backend/cmd/desktop/messagebox_test.go
lanyuanxiaoyao 64dc66afa6 fix: Windows 桌面应用打包问题修复
- 删除通用 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 规范文档
2026-04-22 23:20:39 +08:00

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()
}