You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@kvrocks.apache.org by GitBox <gi...@apache.org> on 2022/10/16 12:03:38 UTC

[GitHub] [incubator-kvrocks] tisonkun commented on a diff in pull request #998: Move TCL test unit/geo to Go case

tisonkun commented on code in PR #998:
URL: https://github.com/apache/incubator-kvrocks/pull/998#discussion_r996433315


##########
tests/gocase/unit/geo/geo_test.go:
##########
@@ -0,0 +1,315 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package geo
+
+import (
+	"context"
+	"math"
+	"math/rand"
+	"reflect"
+	"sort"
+	"strconv"
+	"testing"
+	"time"
+
+	"github.com/apache/incubator-kvrocks/tests/gocase/util"
+	"github.com/go-redis/redis/v9"
+	"github.com/stretchr/testify/require"
+)
+
+func geoDegrad(deg float64) float64 {
+	return deg * math.Atan(1) * 8 / 360
+}
+
+func geoRandomPoint() (float64, float64) {
+	lon := (-180 + rand.Float64()*360)
+	lat := (-70 + rand.Float64()*140)
+	return lon, lat
+}
+
+func geoDistance(lon1d, lat1d, lon2d, lat2d float64) float64 {
+	lon1r := geoDegrad(lon1d)
+	lat1r := geoDegrad(lat1d)
+	lon2r := geoDegrad(lon2d)
+	lat2r := geoDegrad(lat2d)
+	v := math.Sin((lon2r - lon1r) / 2)
+	u := math.Sin((lat2r - lat1r) / 2)
+	return 2.0 * 6372797.560856 * math.Asin(math.Sqrt(u*u+math.Cos(lat1r)*math.Cos(lat2r)*v*v))
+}
+
+func compareLists(list1, list2 []string) []string {
+	vis := make(map[string]int)
+	var result []string
+	for i := 0; i < len(list1); i++ {
+		j := i
+		for j+1 < len(list1) && list1[j+1] == list1[i] {
+			j++
+		}
+		vis[list1[i]] += 1
+		i = j
+	}
+	for i := 0; i < len(list2); i++ {
+		j := i
+		for j+1 < len(list2) && list2[j+1] == list2[i] {
+			j++
+		}
+		vis[list2[i]] += 1
+		i = j
+	}
+	for _, i := range list1 {
+		if val, ok := vis[i]; ok && val == 1 {
+			result = append(result, i)
+		}
+	}
+	for _, i := range list2 {
+		if val, ok := vis[i]; ok && val == 1 {
+			result = append(result, i)
+		}
+	}
+	return result
+}
+
+func TestGeo(t *testing.T) {
+	srv := util.StartServer(t, map[string]string{})
+	defer srv.Close()
+	ctx := context.Background()
+	rdb := srv.NewClient()
+	defer func() { require.NoError(t, rdb.Close()) }()
+	t.Run("GEOADD create", func(t *testing.T) {
+		require.EqualValues(t, 1, rdb.GeoAdd(ctx, "nyc", &redis.GeoLocation{Name: "lic market", Longitude: -73.9454966, Latitude: 40.747533}).Val())
+	})
+
+	t.Run("GEOADD update", func(t *testing.T) {
+		require.EqualValues(t, 0, rdb.GeoAdd(ctx, "nyc", &redis.GeoLocation{Name: "lic market", Longitude: -73.9454966, Latitude: 40.747533}).Val())
+	})
+
+	t.Run("GEOADD invalid coordinates", func(t *testing.T) {
+		require.ErrorContains(t, rdb.Do(ctx, "geoadd", "nyc", -73.9454966, 40.747533, "lic market", "foo", "bar", "luck market").Err(), "valid")
+	})
+
+	t.Run("GEOADD multi add", func(t *testing.T) {
+		require.EqualValues(t, 6, rdb.GeoAdd(ctx, "nyc", &redis.GeoLocation{Name: "central park n/q/r", Longitude: -73.9733487, Latitude: 40.7648057},
+			&redis.GeoLocation{Name: "union square", Longitude: -73.9903085, Latitude: 40.7362513},
+			&redis.GeoLocation{Name: "wtc one", Longitude: -74.0131604, Latitude: 40.7126674},
+			&redis.GeoLocation{Name: "jfk", Longitude: -73.7858139, Latitude: 40.6428986},
+			&redis.GeoLocation{Name: "q4", Longitude: -73.9375699, Latitude: 40.7498929},
+			&redis.GeoLocation{Name: "4545", Longitude: -73.9564142, Latitude: 40.7480973}).Val())
+	})
+
+	t.Run("Check geoset values", func(t *testing.T) {
+		require.EqualValues(t, []redis.Z([]redis.Z{{Score: 1.79187397205302e+15, Member: "wtc one"}, {Score: 1.791875485187452e+15, Member: "union square"}, {Score: 1.791875761332224e+15, Member: "central park n/q/r"}, {Score: 1.791875796750882e+15, Member: "4545"}, {Score: 1.791875804419201e+15, Member: "lic market"}, {Score: 1.791875830079666e+15, Member: "q4"}, {Score: 1.791895905559723e+15, Member: "jfk"}}), rdb.ZRangeWithScores(ctx, "nyc", 0, -1).Val())
+	})
+
+	t.Run("GEORADIUS simple (sorted)", func(t *testing.T) {
+		require.EqualValues(t, []redis.GeoLocation([]redis.GeoLocation{{Name: "central park n/q/r", Longitude: 0, Latitude: 0, Dist: 0, GeoHash: 0}, {Name: "4545", Longitude: 0, Latitude: 0, Dist: 0, GeoHash: 0}, {Name: "union square", Longitude: 0, Latitude: 0, Dist: 0, GeoHash: 0}}), rdb.GeoRadius(ctx, "nyc", -73.9798091, 40.7598464, &redis.GeoRadiusQuery{Radius: 3, Unit: "km", Sort: "asc"}).Val())
+	})
+
+	t.Run("GEORADIUS with COUNT", func(t *testing.T) {
+		require.EqualValues(t, []redis.GeoLocation([]redis.GeoLocation{{Name: "central park n/q/r", Longitude: 0, Latitude: 0, Dist: 0, GeoHash: 0}, {Name: "4545", Longitude: 0, Latitude: 0, Dist: 0, GeoHash: 0}, {Name: "union square", Longitude: 0, Latitude: 0, Dist: 0, GeoHash: 0}}), rdb.GeoRadius(ctx, "nyc", -73.9798091, 40.7598464, &redis.GeoRadiusQuery{Radius: 10, Unit: "km", Sort: "asc", Count: 3}).Val())
+	})
+
+	t.Run("GEORADIUS HUGE, issue #2767", func(t *testing.T) {
+		require.NoError(t, rdb.GeoAdd(ctx, "users", &redis.GeoLocation{Name: "user_000000", Longitude: -47.271613776683807, Latitude: -54.534504198047678}).Err())
+		require.EqualValues(t, 1, len(rdb.GeoRadius(ctx, "users", 0, 0, &redis.GeoRadiusQuery{Radius: 50000, Unit: "km", WithCoord: true}).Val()))
+	})
+
+	t.Run("GEORADIUSBYMEMBER simple (sorted)", func(t *testing.T) {
+		require.EqualValues(t, []redis.GeoLocation([]redis.GeoLocation{{Name: "wtc one", Longitude: 0, Latitude: 0, Dist: 0, GeoHash: 0}, {Name: "union square", Longitude: 0, Latitude: 0, Dist: 0, GeoHash: 0}, {Name: "central park n/q/r", Longitude: 0, Latitude: 0, Dist: 0, GeoHash: 0}, {Name: "4545", Longitude: 0, Latitude: 0, Dist: 0, GeoHash: 0}, {Name: "lic market", Longitude: 0, Latitude: 0, Dist: 0, GeoHash: 0}}), rdb.GeoRadiusByMember(ctx, "nyc", "wtc one", &redis.GeoRadiusQuery{Radius: 7, Unit: "km"}).Val())
+	})
+
+	t.Run("GEOHASH is able to return geohash strings", func(t *testing.T) {
+		require.NoError(t, rdb.Del(ctx, "points").Err())
+		require.NoError(t, rdb.GeoAdd(ctx, "points", &redis.GeoLocation{Name: "test", Longitude: -5.6, Latitude: 42.6}).Err())
+		require.EqualValues(t, []string([]string{"ezs42e44yx0"}), rdb.GeoHash(ctx, "points", "test").Val())
+	})
+
+	t.Run("GEOPOS simple", func(t *testing.T) {
+		require.NoError(t, rdb.Del(ctx, "points").Err())
+		require.NoError(t, rdb.GeoAdd(ctx, "points", &redis.GeoLocation{Name: "a", Longitude: 10, Latitude: 20}, &redis.GeoLocation{Name: "b", Longitude: 30, Latitude: 40}).Err())
+		cmd := rdb.GeoPos(ctx, "points", "a", "b")
+		require.True(t, math.Abs(cmd.Val()[0].Longitude-10) < 0.001)
+		require.True(t, math.Abs(cmd.Val()[0].Latitude-20) < 0.001)
+		require.True(t, math.Abs(cmd.Val()[1].Longitude-30) < 0.001)
+		require.True(t, math.Abs(cmd.Val()[1].Latitude-40) < 0.001)
+	})
+
+	t.Run("GEOPOS missing element", func(t *testing.T) {
+		require.NoError(t, rdb.Del(ctx, "points").Err())
+		require.NoError(t, rdb.GeoAdd(ctx, "points", &redis.GeoLocation{Name: "a", Longitude: 10, Latitude: 20}, &redis.GeoLocation{Name: "b", Longitude: 30, Latitude: 40}).Err())
+		require.EqualValues(t, (*redis.GeoPos)(nil), rdb.GeoPos(ctx, "points", "a", "x", "b").Val()[1])

Review Comment:
   ```suggestion
   		require.Nil(t, rdb.GeoPos(ctx, "points", "a", "x", "b").Val()[1])
   ```



##########
tests/gocase/unit/geo/geo_test.go:
##########
@@ -0,0 +1,315 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package geo
+
+import (
+	"context"
+	"math"
+	"math/rand"
+	"reflect"
+	"sort"
+	"strconv"
+	"testing"
+	"time"
+
+	"github.com/apache/incubator-kvrocks/tests/gocase/util"
+	"github.com/go-redis/redis/v9"
+	"github.com/stretchr/testify/require"
+)
+
+func geoDegrad(deg float64) float64 {
+	return deg * math.Atan(1) * 8 / 360
+}
+
+func geoRandomPoint() (float64, float64) {
+	lon := (-180 + rand.Float64()*360)
+	lat := (-70 + rand.Float64()*140)
+	return lon, lat
+}
+
+func geoDistance(lon1d, lat1d, lon2d, lat2d float64) float64 {
+	lon1r := geoDegrad(lon1d)
+	lat1r := geoDegrad(lat1d)
+	lon2r := geoDegrad(lon2d)
+	lat2r := geoDegrad(lat2d)
+	v := math.Sin((lon2r - lon1r) / 2)
+	u := math.Sin((lat2r - lat1r) / 2)
+	return 2.0 * 6372797.560856 * math.Asin(math.Sqrt(u*u+math.Cos(lat1r)*math.Cos(lat2r)*v*v))
+}
+
+func compareLists(list1, list2 []string) []string {
+	vis := make(map[string]int)
+	var result []string
+	for i := 0; i < len(list1); i++ {
+		j := i
+		for j+1 < len(list1) && list1[j+1] == list1[i] {
+			j++
+		}
+		vis[list1[i]] += 1
+		i = j
+	}
+	for i := 0; i < len(list2); i++ {
+		j := i
+		for j+1 < len(list2) && list2[j+1] == list2[i] {
+			j++
+		}
+		vis[list2[i]] += 1
+		i = j
+	}
+	for _, i := range list1 {
+		if val, ok := vis[i]; ok && val == 1 {
+			result = append(result, i)
+		}
+	}
+	for _, i := range list2 {
+		if val, ok := vis[i]; ok && val == 1 {
+			result = append(result, i)
+		}
+	}
+	return result
+}
+
+func TestGeo(t *testing.T) {
+	srv := util.StartServer(t, map[string]string{})
+	defer srv.Close()
+	ctx := context.Background()
+	rdb := srv.NewClient()
+	defer func() { require.NoError(t, rdb.Close()) }()
+	t.Run("GEOADD create", func(t *testing.T) {
+		require.EqualValues(t, 1, rdb.GeoAdd(ctx, "nyc", &redis.GeoLocation{Name: "lic market", Longitude: -73.9454966, Latitude: 40.747533}).Val())
+	})
+
+	t.Run("GEOADD update", func(t *testing.T) {
+		require.EqualValues(t, 0, rdb.GeoAdd(ctx, "nyc", &redis.GeoLocation{Name: "lic market", Longitude: -73.9454966, Latitude: 40.747533}).Val())
+	})
+
+	t.Run("GEOADD invalid coordinates", func(t *testing.T) {
+		require.ErrorContains(t, rdb.Do(ctx, "geoadd", "nyc", -73.9454966, 40.747533, "lic market", "foo", "bar", "luck market").Err(), "valid")
+	})
+
+	t.Run("GEOADD multi add", func(t *testing.T) {
+		require.EqualValues(t, 6, rdb.GeoAdd(ctx, "nyc", &redis.GeoLocation{Name: "central park n/q/r", Longitude: -73.9733487, Latitude: 40.7648057},
+			&redis.GeoLocation{Name: "union square", Longitude: -73.9903085, Latitude: 40.7362513},
+			&redis.GeoLocation{Name: "wtc one", Longitude: -74.0131604, Latitude: 40.7126674},
+			&redis.GeoLocation{Name: "jfk", Longitude: -73.7858139, Latitude: 40.6428986},
+			&redis.GeoLocation{Name: "q4", Longitude: -73.9375699, Latitude: 40.7498929},
+			&redis.GeoLocation{Name: "4545", Longitude: -73.9564142, Latitude: 40.7480973}).Val())
+	})
+
+	t.Run("Check geoset values", func(t *testing.T) {
+		require.EqualValues(t, []redis.Z([]redis.Z{{Score: 1.79187397205302e+15, Member: "wtc one"}, {Score: 1.791875485187452e+15, Member: "union square"}, {Score: 1.791875761332224e+15, Member: "central park n/q/r"}, {Score: 1.791875796750882e+15, Member: "4545"}, {Score: 1.791875804419201e+15, Member: "lic market"}, {Score: 1.791875830079666e+15, Member: "q4"}, {Score: 1.791895905559723e+15, Member: "jfk"}}), rdb.ZRangeWithScores(ctx, "nyc", 0, -1).Val())
+	})
+
+	t.Run("GEORADIUS simple (sorted)", func(t *testing.T) {
+		require.EqualValues(t, []redis.GeoLocation([]redis.GeoLocation{{Name: "central park n/q/r", Longitude: 0, Latitude: 0, Dist: 0, GeoHash: 0}, {Name: "4545", Longitude: 0, Latitude: 0, Dist: 0, GeoHash: 0}, {Name: "union square", Longitude: 0, Latitude: 0, Dist: 0, GeoHash: 0}}), rdb.GeoRadius(ctx, "nyc", -73.9798091, 40.7598464, &redis.GeoRadiusQuery{Radius: 3, Unit: "km", Sort: "asc"}).Val())
+	})
+
+	t.Run("GEORADIUS with COUNT", func(t *testing.T) {
+		require.EqualValues(t, []redis.GeoLocation([]redis.GeoLocation{{Name: "central park n/q/r", Longitude: 0, Latitude: 0, Dist: 0, GeoHash: 0}, {Name: "4545", Longitude: 0, Latitude: 0, Dist: 0, GeoHash: 0}, {Name: "union square", Longitude: 0, Latitude: 0, Dist: 0, GeoHash: 0}}), rdb.GeoRadius(ctx, "nyc", -73.9798091, 40.7598464, &redis.GeoRadiusQuery{Radius: 10, Unit: "km", Sort: "asc", Count: 3}).Val())
+	})
+
+	t.Run("GEORADIUS HUGE, issue #2767", func(t *testing.T) {
+		require.NoError(t, rdb.GeoAdd(ctx, "users", &redis.GeoLocation{Name: "user_000000", Longitude: -47.271613776683807, Latitude: -54.534504198047678}).Err())
+		require.EqualValues(t, 1, len(rdb.GeoRadius(ctx, "users", 0, 0, &redis.GeoRadiusQuery{Radius: 50000, Unit: "km", WithCoord: true}).Val()))
+	})
+
+	t.Run("GEORADIUSBYMEMBER simple (sorted)", func(t *testing.T) {
+		require.EqualValues(t, []redis.GeoLocation([]redis.GeoLocation{{Name: "wtc one", Longitude: 0, Latitude: 0, Dist: 0, GeoHash: 0}, {Name: "union square", Longitude: 0, Latitude: 0, Dist: 0, GeoHash: 0}, {Name: "central park n/q/r", Longitude: 0, Latitude: 0, Dist: 0, GeoHash: 0}, {Name: "4545", Longitude: 0, Latitude: 0, Dist: 0, GeoHash: 0}, {Name: "lic market", Longitude: 0, Latitude: 0, Dist: 0, GeoHash: 0}}), rdb.GeoRadiusByMember(ctx, "nyc", "wtc one", &redis.GeoRadiusQuery{Radius: 7, Unit: "km"}).Val())
+	})
+
+	t.Run("GEOHASH is able to return geohash strings", func(t *testing.T) {
+		require.NoError(t, rdb.Del(ctx, "points").Err())
+		require.NoError(t, rdb.GeoAdd(ctx, "points", &redis.GeoLocation{Name: "test", Longitude: -5.6, Latitude: 42.6}).Err())
+		require.EqualValues(t, []string([]string{"ezs42e44yx0"}), rdb.GeoHash(ctx, "points", "test").Val())
+	})
+
+	t.Run("GEOPOS simple", func(t *testing.T) {
+		require.NoError(t, rdb.Del(ctx, "points").Err())
+		require.NoError(t, rdb.GeoAdd(ctx, "points", &redis.GeoLocation{Name: "a", Longitude: 10, Latitude: 20}, &redis.GeoLocation{Name: "b", Longitude: 30, Latitude: 40}).Err())
+		cmd := rdb.GeoPos(ctx, "points", "a", "b")
+		require.True(t, math.Abs(cmd.Val()[0].Longitude-10) < 0.001)
+		require.True(t, math.Abs(cmd.Val()[0].Latitude-20) < 0.001)
+		require.True(t, math.Abs(cmd.Val()[1].Longitude-30) < 0.001)
+		require.True(t, math.Abs(cmd.Val()[1].Latitude-40) < 0.001)

Review Comment:
   Use `require.Less`.



##########
tests/gocase/unit/geo/geo_test.go:
##########
@@ -0,0 +1,315 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package geo
+
+import (
+	"context"
+	"math"
+	"math/rand"
+	"reflect"
+	"sort"
+	"strconv"
+	"testing"
+	"time"
+
+	"github.com/apache/incubator-kvrocks/tests/gocase/util"
+	"github.com/go-redis/redis/v9"
+	"github.com/stretchr/testify/require"
+)
+
+func geoDegrad(deg float64) float64 {
+	return deg * math.Atan(1) * 8 / 360
+}
+
+func geoRandomPoint() (float64, float64) {
+	lon := (-180 + rand.Float64()*360)
+	lat := (-70 + rand.Float64()*140)
+	return lon, lat
+}
+
+func geoDistance(lon1d, lat1d, lon2d, lat2d float64) float64 {
+	lon1r := geoDegrad(lon1d)
+	lat1r := geoDegrad(lat1d)
+	lon2r := geoDegrad(lon2d)
+	lat2r := geoDegrad(lat2d)
+	v := math.Sin((lon2r - lon1r) / 2)
+	u := math.Sin((lat2r - lat1r) / 2)
+	return 2.0 * 6372797.560856 * math.Asin(math.Sqrt(u*u+math.Cos(lat1r)*math.Cos(lat2r)*v*v))
+}
+
+func compareLists(list1, list2 []string) []string {
+	vis := make(map[string]int)
+	var result []string
+	for i := 0; i < len(list1); i++ {
+		j := i
+		for j+1 < len(list1) && list1[j+1] == list1[i] {
+			j++
+		}
+		vis[list1[i]] += 1
+		i = j
+	}
+	for i := 0; i < len(list2); i++ {
+		j := i
+		for j+1 < len(list2) && list2[j+1] == list2[i] {
+			j++
+		}
+		vis[list2[i]] += 1
+		i = j
+	}
+	for _, i := range list1 {
+		if val, ok := vis[i]; ok && val == 1 {
+			result = append(result, i)
+		}
+	}
+	for _, i := range list2 {
+		if val, ok := vis[i]; ok && val == 1 {
+			result = append(result, i)
+		}
+	}
+	return result
+}
+
+func TestGeo(t *testing.T) {
+	srv := util.StartServer(t, map[string]string{})
+	defer srv.Close()
+	ctx := context.Background()
+	rdb := srv.NewClient()
+	defer func() { require.NoError(t, rdb.Close()) }()
+	t.Run("GEOADD create", func(t *testing.T) {
+		require.EqualValues(t, 1, rdb.GeoAdd(ctx, "nyc", &redis.GeoLocation{Name: "lic market", Longitude: -73.9454966, Latitude: 40.747533}).Val())
+	})
+
+	t.Run("GEOADD update", func(t *testing.T) {
+		require.EqualValues(t, 0, rdb.GeoAdd(ctx, "nyc", &redis.GeoLocation{Name: "lic market", Longitude: -73.9454966, Latitude: 40.747533}).Val())
+	})
+
+	t.Run("GEOADD invalid coordinates", func(t *testing.T) {
+		require.ErrorContains(t, rdb.Do(ctx, "geoadd", "nyc", -73.9454966, 40.747533, "lic market", "foo", "bar", "luck market").Err(), "valid")
+	})
+
+	t.Run("GEOADD multi add", func(t *testing.T) {
+		require.EqualValues(t, 6, rdb.GeoAdd(ctx, "nyc", &redis.GeoLocation{Name: "central park n/q/r", Longitude: -73.9733487, Latitude: 40.7648057},
+			&redis.GeoLocation{Name: "union square", Longitude: -73.9903085, Latitude: 40.7362513},
+			&redis.GeoLocation{Name: "wtc one", Longitude: -74.0131604, Latitude: 40.7126674},
+			&redis.GeoLocation{Name: "jfk", Longitude: -73.7858139, Latitude: 40.6428986},
+			&redis.GeoLocation{Name: "q4", Longitude: -73.9375699, Latitude: 40.7498929},
+			&redis.GeoLocation{Name: "4545", Longitude: -73.9564142, Latitude: 40.7480973}).Val())
+	})
+
+	t.Run("Check geoset values", func(t *testing.T) {
+		require.EqualValues(t, []redis.Z([]redis.Z{{Score: 1.79187397205302e+15, Member: "wtc one"}, {Score: 1.791875485187452e+15, Member: "union square"}, {Score: 1.791875761332224e+15, Member: "central park n/q/r"}, {Score: 1.791875796750882e+15, Member: "4545"}, {Score: 1.791875804419201e+15, Member: "lic market"}, {Score: 1.791875830079666e+15, Member: "q4"}, {Score: 1.791895905559723e+15, Member: "jfk"}}), rdb.ZRangeWithScores(ctx, "nyc", 0, -1).Val())
+	})
+
+	t.Run("GEORADIUS simple (sorted)", func(t *testing.T) {
+		require.EqualValues(t, []redis.GeoLocation([]redis.GeoLocation{{Name: "central park n/q/r", Longitude: 0, Latitude: 0, Dist: 0, GeoHash: 0}, {Name: "4545", Longitude: 0, Latitude: 0, Dist: 0, GeoHash: 0}, {Name: "union square", Longitude: 0, Latitude: 0, Dist: 0, GeoHash: 0}}), rdb.GeoRadius(ctx, "nyc", -73.9798091, 40.7598464, &redis.GeoRadiusQuery{Radius: 3, Unit: "km", Sort: "asc"}).Val())
+	})
+
+	t.Run("GEORADIUS with COUNT", func(t *testing.T) {
+		require.EqualValues(t, []redis.GeoLocation([]redis.GeoLocation{{Name: "central park n/q/r", Longitude: 0, Latitude: 0, Dist: 0, GeoHash: 0}, {Name: "4545", Longitude: 0, Latitude: 0, Dist: 0, GeoHash: 0}, {Name: "union square", Longitude: 0, Latitude: 0, Dist: 0, GeoHash: 0}}), rdb.GeoRadius(ctx, "nyc", -73.9798091, 40.7598464, &redis.GeoRadiusQuery{Radius: 10, Unit: "km", Sort: "asc", Count: 3}).Val())
+	})
+
+	t.Run("GEORADIUS HUGE, issue #2767", func(t *testing.T) {

Review Comment:
   ```suggestion
   	t.Run("GEORADIUS HUGE, (redis issue #2767)", func(t *testing.T) {
   ```



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@kvrocks.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org