ci-platforms / build (amd64, darwin, macos-15-intel) (push) Skipped
ci-platforms / build (amd64, windows, windows-2022) (push) Skipped
ci-platforms / build (arm64, darwin, macos-15) (push) Skipped
ci / checks (push) Successful in 21m57s
ci / build (amd64, linux, ubuntu-24.04) (push) Successful in 23m31s
23 lines
608 B
Go
23 lines
608 B
Go
package refs
|
|
|
|
import (
|
|
"testing"
|
|
|
|
"aego/core/ids"
|
|
"aego/format/aetext"
|
|
)
|
|
|
|
func TestTextPlaces(t *testing.T) {
|
|
id := ids.AssetID{Hi: 7, Lo: 9}
|
|
src := "scene version=1 {\n node \"n1\" name=\"Player\" {\n component \"engine.SpriteRenderer\" version=1 {\n sprite = " +
|
|
string(Token(id)) + "\n }\n }\n}\n"
|
|
doc, err := aetext.Parse([]byte(src), "x.aescene")
|
|
if err != nil {
|
|
t.Fatal(err)
|
|
}
|
|
got := textPlaces(doc, vAsset, id.String())
|
|
if len(got) != 1 || got[0].Path != "Player" || got[0].Owner != "engine.SpriteRenderer" || got[0].Field != "sprite" {
|
|
t.Fatalf("places = %+v", got)
|
|
}
|
|
}
|