update core: signed release.json (Ed25519) per channel, ETag check, resumable download with sha256, Auto/Ask/Off policy, appliers for the install.sh layout, AppImage, NSIS installer (keeps the replaced setup.exe for Restore) and .app, trial run with rollback.
Editor and launcher: banner, status bar, Help commands, Task Center download, install on restart.
CLI: aego update, aego release keygen|manifest, aego export --release-json.
Games: modules/update with update { url publicKey }, settings and the aego/update script API.
release.sh refuses to publish without AEGO_RELEASE_KEY and AEGO_UPDATE_KEY; install.sh lays out versions; make test-update runs a real v1 -> v2 update.
50 lines
1.4 KiB
Go
50 lines
1.4 KiB
Go
package edit
|
|
|
|
import (
|
|
"os"
|
|
"path/filepath"
|
|
"slices"
|
|
"testing"
|
|
|
|
"aego/project"
|
|
)
|
|
|
|
func TestRelaunchArgs(t *testing.T) {
|
|
cases := []struct {
|
|
verb, target, tab string
|
|
want []string
|
|
}{
|
|
{"", "/p", "", []string{"/p"}},
|
|
{"", "", "recent", []string{"-launcher", "recent"}},
|
|
{"edit", "/p", "", []string{"edit", "/p"}},
|
|
{"edit", "", "new", []string{"edit", "--launcher", "new"}},
|
|
}
|
|
for _, c := range cases {
|
|
if got := relaunchArgs(c.verb, c.target, c.tab); !slices.Equal(got, c.want) {
|
|
t.Errorf("%q %q %q: %v, want %v", c.verb, c.target, c.tab, got, c.want)
|
|
}
|
|
}
|
|
env := withoutEnv([]string{"A=1", "AEGO_SUPERVISED=1", "B=2"}, "AEGO_SUPERVISED")
|
|
if !slices.Equal(env, []string{"A=1", "B=2"}) {
|
|
t.Fatal(env)
|
|
}
|
|
}
|
|
|
|
func TestResolveArg(t *testing.T) {
|
|
root := t.TempDir()
|
|
os.WriteFile(filepath.Join(root, project.FileName), []byte("project version=1 {\n}\n"), 0o644)
|
|
os.MkdirAll(filepath.Join(root, "scenes"), 0o755)
|
|
scene := filepath.Join(root, "scenes", "main.aescene")
|
|
os.WriteFile(scene, []byte("scene version=1 {\n}\n"), 0o644)
|
|
if dir, file := resolveArg(filepath.Join(root, project.FileName)); dir != root || file != "" {
|
|
t.Fatalf("project.aego: %q %q", dir, file)
|
|
}
|
|
dir, file := resolveArg(scene)
|
|
if dir != filepath.Join(root, "scenes") || file != scene {
|
|
t.Fatalf("scene: %q %q", dir, file)
|
|
}
|
|
if rel, ok := relInside(root, file); !ok || rel != "scenes/main.aescene" {
|
|
t.Fatalf("rel %q %v", rel, ok)
|
|
}
|
|
}
|