MCPcopy
hub / github.com/EngoEngine/engo / TestCameraMoveToX

Function TestCameraMoveToX

common/camera_test.go:122–135  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

120}
121
122func TestCameraMoveToX(t *testing.T) {
123 initialize()
124
125 currentX := cam.X()
126
127 cam.moveToX(currentX + 5)
128 assert.Equal(t, cam.X(), currentX+5, "Moving to current + 5 should get us to current + 5")
129
130 cam.moveToX(600)
131 assert.Equal(t, cam.X(), CameraBounds.Max.X, "Moving to a location out of bounds, should get us to the maximum")
132
133 cam.moveToX(-10)
134 assert.Equal(t, cam.X(), CameraBounds.Min.X, "Moving to a location out of bounds, should get us to the minimum")
135}
136
137func TestCameraMoveToY(t *testing.T) {
138 initialize()

Callers

nothing calls this directly

Calls 4

initializeFunction · 0.85
XMethod · 0.80
moveToXMethod · 0.80
EqualMethod · 0.80

Tested by

no test coverage detected