Backend: Add tests to pkg/s2

This commit is contained in:
Theresa Gresch 2020-04-28 17:04:52 +02:00
parent ddc696c650
commit 44ce09bb29

View file

@ -93,6 +93,13 @@ func TestTokenLevel(t *testing.T) {
assert.Equal(t, expected, token)
})
t.Run("lat & long 0.0", func(t *testing.T) {
token := TokenLevel(0.0, 0.0, 30)
expected := ""
assert.Equal(t, expected, token)
})
}
func TestLatLng(t *testing.T) {
@ -107,6 +114,11 @@ func TestLatLng(t *testing.T) {
assert.Equal(t, 0.0, lat)
assert.Equal(t, 0.0, lng)
})
t.Run("empty", func(t *testing.T) {
lat, lng := LatLng("")
assert.Equal(t, 0.0, lat)
assert.Equal(t, 0.0, lng)
})
}
func TestIsZero(t *testing.T) {