Backend: Add tests to pkg/s2
This commit is contained in:
parent
ddc696c650
commit
44ce09bb29
1 changed files with 12 additions and 0 deletions
|
@ -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) {
|
||||
|
|
Loading…
Reference in a new issue