-
Notifications
You must be signed in to change notification settings - Fork 16
Expand file tree
/
Copy pathpointsiter_test.go
More file actions
43 lines (40 loc) · 793 Bytes
/
Copy pathpointsiter_test.go
File metadata and controls
43 lines (40 loc) · 793 Bytes
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
42
43
package geom
import (
"testing"
)
func TestGeom_points(t *testing.T) {
tests := []Geom{
Point{0, 1},
MultiPoint{{0, 1}, {0, 2}},
LineString{{0, 1}, {0, 2}},
MultiLineString{{{0, 1}, {0, 2}}, {{0, 3}, {0, 4}}},
Polygon{
{{0, 1}, {0, 2}}, {{0, 3}, {0, 4}},
{{0, 5}, {0, 6}}, {{0, 7}, {0, 8}},
},
MultiPolygon{
{
{{0, 1}, {0, 2}}, {{0, 3}, {0, 4}},
{{0, 5}, {0, 6}}, {{0, 7}, {0, 8}},
},
{
{{0, 9}, {0, 10}},
{{0, 11}, {0, 12}},
},
},
GeometryCollection{
Point{0, 1},
MultiPoint{{0, 2}, {0, 3}},
},
}
for j, test := range tests {
pf := test.Points()
for i := 0; i < test.Len(); i++ {
want := Point{0, float64(i + 1)}
p := pf()
if p != want {
t.Errorf("test %d index %d: %+v != %+v", j, i, p, want)
}
}
}
}