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.
42 lines
976 B
Go
42 lines
976 B
Go
package playground
|
|
|
|
import (
|
|
"regexp"
|
|
"testing"
|
|
|
|
"aego/app/assembly/builtin"
|
|
)
|
|
|
|
func TestCheckSnippetsCompile(t *testing.T) {
|
|
p, err := NewWith(builtin.Default())
|
|
if err != nil {
|
|
t.Fatal(err)
|
|
}
|
|
n := 0
|
|
for _, e := range p.docs.All() {
|
|
files := map[string]string{}
|
|
for _, s := range e.Snippets {
|
|
if !s.Check || s.Lang != "aes" {
|
|
continue
|
|
}
|
|
n++
|
|
name := "main"
|
|
if m := scriptDecl.FindStringSubmatch(s.Code); m != nil {
|
|
name = m[1] + "/" + m[2]
|
|
}
|
|
files[name] = s.Code
|
|
for _, d := range p.Compile(files) {
|
|
if d.Severity == "error" {
|
|
t.Errorf("%s (line %d of its page): %d:%d %s %s", e.ID, s.Line, d.Line, d.Col, d.Code, d.Message)
|
|
}
|
|
}
|
|
}
|
|
}
|
|
if n == 0 {
|
|
t.Fatal("no aes check blocks in the documentation")
|
|
}
|
|
}
|
|
|
|
// scriptDecl names a block by package and script, so a later block of a page replaces an earlier version of the same script.
|
|
var scriptDecl = regexp.MustCompile(`(?m)^package (\w+)[\s\S]*?^script (\w+)`)
|