Documentation ¶
Index ¶
- func MatchesImage(t *testing.T, imageName string, img image.Image) bool
- func OnTestMain(m *testing.M)
- func QueueDrawTest(t *testing.T, f func(t *testing.T, screen *ebiten.Image))
- func QueueLayoutTest(t *testing.T, ...)
- func QueueUpdateTest(t *testing.T, f func(t *testing.T))
- type DrawTest
- type DrawTestFunc
- type LayoutTest
- type LayoutTestFunc
- type TestGame
- type UpdateTest
- type UpdateTestFunc
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func MatchesImage ¶
MatchesImage compares an image.Image to "testdata/expected/<imageName>.png". If img is not nil, it attempts to open "testdata/expected/<imageName>.png". If it succeeds, it converts it to an image.Image, and then compares the two images. If it fails, it writes the image to "testdata/failed/<imageName>.png" and raises a test failure. It can handle *ebiten.Images and save them as PNGs. Also returns true if the images match, and false if they don't.
func OnTestMain ¶
func QueueLayoutTest ¶
Types ¶
type DrawTestFunc ¶
type LayoutTest ¶
type LayoutTest struct {
// contains filtered or unexported fields
}
type LayoutTestFunc ¶
type UpdateTest ¶
type UpdateTest struct {
// contains filtered or unexported fields
}
type UpdateTestFunc ¶
Click to show internal directories.
Click to hide internal directories.