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

Function TestPointSet

math_test.go:206–222  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

204}
205
206func TestPointSet(t *testing.T) {
207 data := []Point{
208 {X: 0, Y: 0},
209 {X: 3, Y: 3},
210 {X: 2, Y: 1},
211 {X: 0, Y: 0},
212 {X: -3, Y: 2},
213 {X: 6, Y: -4},
214 {X: -1, Y: -3},
215 }
216 p := Point{X: 0.5, Y: 0.5}
217 for _, d := range data {
218 if p.Set(d.X, d.Y); !p.Equal(d) {
219 t.Errorf("Test Point.Set failed. wanted: %v, got:%v", d, p)
220 }
221 }
222}
223
224func TestPointPointDistance(t *testing.T) {
225 data := []struct {

Callers

nothing calls this directly

Calls 2

SetMethod · 0.95
EqualMethod · 0.95

Tested by

no test coverage detected