Permalink
Browse files

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.
  • Loading branch information...
1 parent 0f72257 commit af0284926c5883c1cd1a0bb40188a6897cf11829 @antirez committed Dec 20, 2016
Showing with 3 additions and 2 deletions.
  1. +3 −2 tests/unit/geo.tcl
View
@@ -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]]

0 comments on commit af02849

Please sign in to comment.