recator, test: race relation

This commit is contained in:
Ilia Denisov
2026-02-08 10:11:58 +02:00
parent fc73cbf83a
commit c36857e702
6 changed files with 49 additions and 69 deletions
+4 -4
View File
@@ -29,7 +29,7 @@ func TestComposeGame(t *testing.T) {
})
}
func g(t *testing.T, f func(p func(*controller.Param), g func() *mg.Game)) {
func g(t *testing.T, f func(func(*controller.Param), func() *mg.Game)) {
root, cleanup := util.CreateWorkDir(t)
defer cleanup()
races := make([]string, testRaceCount)
@@ -53,7 +53,7 @@ func g(t *testing.T, f func(p func(*controller.Param), g func() *mg.Game)) {
f(p, g)
}
func c(t *testing.T, f func(p func(*controller.Param), g func() *controller.Controller)) {
func c(t *testing.T, f func(func(*controller.Param), func() *controller.Controller)) {
root, cleanup := util.CreateWorkDir(t)
defer cleanup()
races := make([]string, testRaceCount)
@@ -66,7 +66,7 @@ func c(t *testing.T, f func(p func(*controller.Param), g func() *controller.Cont
assert.FailNow(t, "c: GenerateGame", err)
return
}
ctl := func() *controller.Controller {
ctrl := func() *controller.Controller {
c, err := controller.NewController(p)
if err != nil {
assert.FailNow(t, "c: NewController", err)
@@ -80,5 +80,5 @@ func c(t *testing.T, f func(p func(*controller.Param), g func() *controller.Cont
c.Cache = controller.NewCache(g)
return c
}
f(p, ctl)
f(p, ctrl)
}