summaryrefslogtreecommitdiff
path: root/tests/unit
diff options
context:
space:
mode:
authorfilipe oliveira <filipecosta.90@gmail.com>2022-12-15 20:25:38 +0000
committerGitHub <noreply@github.com>2022-12-15 22:25:38 +0200
commitd7b4c9175e89c68aadd8e4a0e1cfb8530e473533 (patch)
tree8c8b4a7771dce5d9b12e1aa3b9814bc9fac9eb99 /tests/unit
parentdf327b8bd56023931cd41e233f8703de7bbaa82c (diff)
downloadredis-d7b4c9175e89c68aadd8e4a0e1cfb8530e473533.tar.gz
Fixed small distance replies on GEODIST and GEO commands WITHDIST (#11631)
Fixes a regression introduced by #11552 in 7.0.6. it causes replies in the GEO commands to contain garbage when the result is a very small distance (less than 1) Includes test to confirm indeed with junk in buffer now we properly reply
Diffstat (limited to 'tests/unit')
-rw-r--r--tests/unit/geo.tcl7
1 files changed, 7 insertions, 0 deletions
diff --git a/tests/unit/geo.tcl b/tests/unit/geo.tcl
index a6a6cbcb6..e07a6784c 100644
--- a/tests/unit/geo.tcl
+++ b/tests/unit/geo.tcl
@@ -516,6 +516,13 @@ start_server {tags {"geo"}} {
assert_equal {point2 point1} [r geosearch points fromlonlat -179 37 bybox 400 400 km asc]
}
+ test {GEOSEARCH with small distance} {
+ r del points
+ r geoadd points -122.407107 37.794300 1
+ r geoadd points -122.227336 37.794300 2
+ assert_equal {{1 0.0001} {2 9.8182}} [r GEORADIUS points -122.407107 37.794300 30 mi ASC WITHDIST]
+ }
+
foreach {type} {byradius bybox} {
test "GEOSEARCH fuzzy test - $type" {
if {$::accurate} { set attempt 300 } else { set attempt 30 }