format fixes
This commit is contained in:
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user