-
Notifications
You must be signed in to change notification settings - Fork 1
/
iter_test.go
87 lines (77 loc) · 1.82 KB
/
iter_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
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
package h3geodist
import (
"testing"
"github.com/uber/h3-go/v3"
)
func TestIterLevel0(t *testing.T) {
var cells uint
Iter(Level0, func(index uint, cell h3.H3Index) {
cells++
})
if have, want := cells, Level0Area(); have != want {
t.Fatalf("have %d, want %d cells", have, want)
}
}
func TestIterLevel1(t *testing.T) {
var cells uint
Iter(Level1, func(index uint, cell h3.H3Index) {
cells++
})
if have, want := cells, Level1Area(); have != want {
t.Fatalf("have %d, want %d cells", have, want)
}
}
func TestIterLevel2(t *testing.T) {
var cells uint
Iter(Level2, func(index uint, cell h3.H3Index) {
cells++
})
if have, want := cells, Level2Area(); have != want {
t.Fatalf("have %d, want %d cells", have, want)
}
}
func TestIterLevel3(t *testing.T) {
var cells uint
Iter(Level3, func(index uint, cell h3.H3Index) {
cells++
})
if have, want := cells, Level3Area(); have != want {
t.Fatalf("have %d, want %d cells", have, want)
}
}
func TestIterLevel4(t *testing.T) {
var cells uint
Iter(Level4, func(index uint, cell h3.H3Index) {
cells++
})
if have, want := cells, Level4Area(); have != want {
t.Fatalf("have %d, want %d cells", have, want)
}
}
func TestIterLevel5(t *testing.T) {
var cells uint
Iter(Level5, func(index uint, cell h3.H3Index) {
cells++
})
if have, want := cells, Level5Area(); have != want {
t.Fatalf("have %d, want %d cells", have, want)
}
}
func TestIterLevel6(t *testing.T) {
var cells uint
Iter(Level6, func(index uint, cell h3.H3Index) {
cells++
})
if have, want := cells, Level6Area(); have != want {
t.Fatalf("have %d, want %d cells", have, want)
}
}
func TestIterLevel7(t *testing.T) {
var cells uint
Iter(7, func(index uint, cell h3.H3Index) {
cells++
})
if have, want := cells, uint(0); have != want {
t.Fatalf("have %d, want %d cells", have, want)
}
}