Files
aego/tests/integration/template_test.go
sanspie 2e10968d48 Stage 11f3: landing, Getting started, guides; demo fixes (D347, D289)
Landing page and Install Aego / Your first project in English and Russian; the 2D template matches them. Platformer from scratch and Recipes with every step scene run by docs check. Builtin data and handle methods in the reference, Inspector names in field tables, Markdown copies and llms-full.txt, strict docs check in CI, engine/docs/README.md.
Fixes: a body cast from a touching contact uses the face normal, so characters no longer stick after a respawn or against walls; Respawn.resetVelocity works; a touch gamepad on exported web pages.
2026-10-25 15:31:22 +03:00

36 lines
1012 B
Go

package integration
import (
"os"
"path/filepath"
"strings"
"testing"
"aego/app/edit"
"aego/editor/panels/welcome"
)
// A new 2D project matches Getting started: sidecars for every script, a Move action and the Spinner example.
func TestTemplate2DMatchesGettingStarted(t *testing.T) {
root, err := edit.CreateProject(filepath.Join(t.TempDir(), "hello"), "2d", "", "")
if err != nil {
t.Fatal(err)
}
filepath.WalkDir(root, func(p string, d os.DirEntry, err error) error {
if err == nil && filepath.Ext(p) == ".aes" {
if _, err := os.Stat(p + ".meta"); err != nil {
t.Errorf("%s has no .meta", p)
}
}
return nil
})
data, err := os.ReadFile(filepath.Join(root, "project.aego"))
if err != nil || !strings.Contains(string(data), "name=Move") {
t.Fatalf("project.aego has no Move action: %v", err)
}
wrote, err := welcome.Example(filepath.Join(root, "scripts"))
if err != nil || !wrote {
t.Fatalf("the Spinner example is not written into a 2D project: %v %v", wrote, err)
}
}