mirror of
https://github.com/hajimehoshi/ebiten.git
synced 2025-02-05 15:34:28 +01:00
internal/processteset/testdta: bug fix: compile error
This commit is contained in:
parent
67178c9534
commit
966823e445
7
internal/processtest/testdata/issue2362.go
vendored
7
internal/processtest/testdata/issue2362.go
vendored
@ -18,19 +18,22 @@
|
||||
package main
|
||||
|
||||
import (
|
||||
"errors"
|
||||
"fmt"
|
||||
"image/color"
|
||||
|
||||
"github.com/hajimehoshi/ebiten/v2"
|
||||
)
|
||||
|
||||
var regularTermination = errors.New("regular termination")
|
||||
|
||||
type Game struct {
|
||||
drawCount int
|
||||
}
|
||||
|
||||
func (g *Game) Update() error {
|
||||
if g.drawCount == 2 {
|
||||
return ebiten.Termination
|
||||
return regularTermination
|
||||
}
|
||||
return nil
|
||||
}
|
||||
@ -56,7 +59,7 @@ func main() {
|
||||
ebiten.SetWindowTitle("Test")
|
||||
ebiten.SetScreenClearedEveryFrame(false)
|
||||
|
||||
if err := ebiten.RunGame(&Game{}); err != nil {
|
||||
if err := ebiten.RunGame(&Game{}); err != nil && !errors.Is(err, regularTermination) {
|
||||
panic(err)
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user