format fixes

This commit is contained in:
2026-08-29 23:33:29 +02:00
parent 954bd762f7
commit 1fa19f0b2e
23 changed files with 335 additions and 147 deletions
+43 -5
View File
@@ -9,19 +9,57 @@ import (
func TestScreenNavWrapsBothWays(t *testing.T) {
g := inkwell.NewGame("t", ScreenW, ScreenH)
for _, n := range []string{"a", "b", "c"} {
g.SceneManager.Register(inkwell.Scene{Name: n, Background: "bg"})
g.SceneManager.Register(inkwell.Scene{
Name: n,
Background: "bg",
})
}
w := newWorld(g)
nav := &screenNav{Name: "screen_nav", W: w}
at := func(name string) { EnterScene(w, name).Start().Tick(&inkwell.Ctx{Game: g}) }
nav := &screenNav{
Name: "screen_nav",
W: w,
}
at := func(name string) {
EnterScene(w, name).Start().Tick(&inkwell.Ctx{
Game: g,
})
}
for _, tc := range []struct {
from string
step int
want string
}{
{"a", 1, "b"}, {"b", 1, "c"}, {"c", 1, "a"},
{"c", -1, "b"}, {"b", -1, "a"}, {"a", -1, "c"},
{
from: "a",
step: 1,
want: "b",
},
{
from: "b",
step: 1,
want: "c",
},
{
from: "c",
step: 1,
want: "a",
},
{
from: "c",
step: -1,
want: "b",
},
{
from: "b",
step: -1,
want: "a",
},
{
from: "a",
step: -1,
want: "c",
},
} {
at(tc.from)
if got := nav.neighbour(g, tc.step); got != tc.want {