Skip to content

Commit

Permalink
Fix benchmarks mocks (#22)
Browse files Browse the repository at this point in the history
* Fix mocks

* Test mocks
  • Loading branch information
t-geindre authored Oct 13, 2024
1 parent dba7b8c commit 5b716a5
Show file tree
Hide file tree
Showing 4 changed files with 27 additions and 3 deletions.
2 changes: 1 addition & 1 deletion test/mock/sysa.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ func NewSysA() *SysA {
return &SysA{}
}

func (s *SysA) Update(e golem.Entity, _ golem.World) {
func (s *SysA) Update(e golem.Entity, _ golem.World, _ golem.Clock) {
s.update(e)
}

Expand Down
2 changes: 1 addition & 1 deletion test/mock/sysb.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ func NewSysB() *SysB {
return &SysB{}
}

func (s *SysB) Update(e golem.Entity, _ golem.World) {
func (s *SysB) Update(e golem.Entity, _ golem.World, _ golem.Clock) {
s.update(e)
}

Expand Down
2 changes: 1 addition & 1 deletion test/mock/sysc.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ func NewSysC() *SysC {
return &SysC{}
}

func (s *SysC) Update(e golem.Entity, _ golem.World) {
func (s *SysC) Update(e golem.Entity, _ golem.World, _ golem.Clock) {
s.update(e)
}

Expand Down
24 changes: 24 additions & 0 deletions test/mock/systems_test.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
package mock

import (
"github.com/t-geindre/golem/pkg/golemutils"
"testing"
)

func TestSysA(t *testing.T) {
s := NewSysA()
golemutils.AssertImplementsUpdater("System A", s, t)
golemutils.AssertImplementsDrawer("System A", s, t)
}

func TestSysB(t *testing.T) {
s := NewSysB()
golemutils.AssertImplementsUpdater("System B", s, t)
golemutils.AssertImplementsDrawer("System B", s, t)
}

func TestSysC(t *testing.T) {
s := NewSysC()
golemutils.AssertImplementsUpdater("System C", s, t)
golemutils.AssertImplementsDrawer("System C", s, t)
}

0 comments on commit 5b716a5

Please sign in to comment.