From af0284926c5883c1cd1a0bb40188a6897cf11829 Mon Sep 17 00:00:00 2001 From: antirez Date: Tue, 20 Dec 2016 12:22:11 +0100 Subject: [PATCH] Geo: fuzzy test inconsistency report fixed to show all points. We need to report all the points added into the set, not just the ones matching the Tcl distance algo. --- tests/unit/geo.tcl | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/tests/unit/geo.tcl b/tests/unit/geo.tcl index 44a0ae1b..fdbfbf13 100644 --- a/tests/unit/geo.tcl +++ b/tests/unit/geo.tcl @@ -254,10 +254,11 @@ start_server {tags {"geo"}} { for {set j 0} {$j < 20000} {incr j} { geo_random_point lon lat lappend argv $lon $lat "place:$j" - if {[geo_distance $lon $lat $search_lon $search_lat] < $radius_m} { + set distance [geo_distance $lon $lat $search_lon $search_lat] + if {$distance < $radius_m} { lappend tcl_result "place:$j" - lappend debuginfo "place:$j $lon $lat [expr {[geo_distance $lon $lat $search_lon $search_lat]/1000}] km" } + lappend debuginfo "place:$j $lon $lat [expr {$distance/1000}] km" } r geoadd mypoints {*}$argv set res [lsort [r georadius mypoints $search_lon $search_lat $radius_km km]]