Fusion copies prep icon and version info via go-winres; optional Garble obfuscation, Authenticode signing, and dry-run size estimates. Forge Simple mode with smart defaults; fleet roster gets compact expandable cards, filters, bulk commands, per-agent notes/tags, and typed WebSocket payloads.
37 lines
771 B
Go
37 lines
771 B
Go
package builder
|
|
|
|
import (
|
|
"os"
|
|
"path/filepath"
|
|
"strings"
|
|
"testing"
|
|
)
|
|
|
|
func TestWriteIconAndVersionWinresJSON(t *testing.T) {
|
|
dir := t.TempDir()
|
|
full := filepath.Join(dir, "winres.json")
|
|
if err := os.WriteFile(full, []byte(`{
|
|
"RT_GROUP_ICON": {
|
|
"#1": { "0409": "a.ico" }
|
|
},
|
|
"RT_VERSION": { "#1": { "0409": {} } }
|
|
}`), 0644); err != nil {
|
|
t.Fatal(err)
|
|
}
|
|
out, err := writeIconAndVersionWinresJSON(full)
|
|
if err != nil {
|
|
t.Fatal(err)
|
|
}
|
|
raw, err := os.ReadFile(out)
|
|
if err != nil {
|
|
t.Fatal(err)
|
|
}
|
|
s := string(raw)
|
|
if !strings.Contains(s, "RT_GROUP_ICON") || !strings.Contains(s, "a.ico") {
|
|
t.Fatalf("unexpected icons-only json: %s", raw)
|
|
}
|
|
if !strings.Contains(s, "RT_VERSION") {
|
|
t.Fatalf("version info should be preserved: %s", raw)
|
|
}
|
|
}
|