Prevented test results order mattering
This commit is contained in:
parent
bcda85acd2
commit
364a7a84ae
|
@ -839,6 +839,16 @@ func TestRect_IntersectCircle(t *testing.T) {
|
||||||
}
|
}
|
||||||
|
|
||||||
func TestRect_IntersectionPoints(t *testing.T) {
|
func TestRect_IntersectionPoints(t *testing.T) {
|
||||||
|
in := func(v pixel.Vec, vs []pixel.Vec) bool {
|
||||||
|
for _, vec := range vs {
|
||||||
|
if vec == v {
|
||||||
|
return true
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
|
||||||
type fields struct {
|
type fields struct {
|
||||||
Min pixel.Vec
|
Min pixel.Vec
|
||||||
Max pixel.Vec
|
Max pixel.Vec
|
||||||
|
@ -877,8 +887,14 @@ func TestRect_IntersectionPoints(t *testing.T) {
|
||||||
Min: tt.fields.Min,
|
Min: tt.fields.Min,
|
||||||
Max: tt.fields.Max,
|
Max: tt.fields.Max,
|
||||||
}
|
}
|
||||||
if got := r.IntersectionPoints(tt.args.l); !reflect.DeepEqual(got, tt.want) {
|
got := r.IntersectionPoints(tt.args.l)
|
||||||
t.Errorf("Rect.IntersectPoints() = %v, want %v", got, tt.want)
|
if len(got) != len(tt.want) {
|
||||||
|
t.Errorf("Rect.IntersectPoints() has incorrect length. Expected %d, got %d", len(tt.want), len(got))
|
||||||
|
}
|
||||||
|
for _, v := range got {
|
||||||
|
if !in(v, tt.want) {
|
||||||
|
t.Errorf("Rect.IntersectPoints(): got unexpected result = %v", v)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue