forked from paulmach/orb
-
Notifications
You must be signed in to change notification settings - Fork 0
/
equal_test.go
41 lines (34 loc) · 834 Bytes
/
equal_test.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
package orb
import (
"fmt"
"testing"
)
func TestEqual(t *testing.T) {
for _, g := range AllGeometries {
// this closure is necessary if tests are run in parallel, maybe
func(geom Geometry) {
t.Run(fmt.Sprintf("%T", g), func(t *testing.T) {
if !Equal(geom, geom) {
t.Errorf("%T not equal", g)
}
})
}(g)
}
}
func TestEqualRing(t *testing.T) {
if Equal(Ring{}, LineString{}) {
t.Errorf("should return false since different types")
}
if Equal(Ring{}, Polygon{}) {
t.Errorf("should return false since different types")
}
if Equal(Polygon{}, Ring{}) {
t.Errorf("should return false since different types")
}
if Equal(Polygon{}, Bound{}) {
t.Errorf("should return false since different types")
}
if Equal(Bound{}, Polygon{}) {
t.Errorf("should return false since different types")
}
}