diff options
author | antirez <antirez@gmail.com> | 2016-12-20 12:22:11 +0100 |
---|---|---|
committer | antirez <antirez@gmail.com> | 2016-12-20 12:22:11 +0100 |
commit | af0284926c5883c1cd1a0bb40188a6897cf11829 (patch) | |
tree | dec7a463e78469740ce618fa57293dd6ff645410 | |
parent | 0f72257049f76c8371e2dc18336a4d1015d06a99 (diff) | |
download | redis-af0284926c5883c1cd1a0bb40188a6897cf11829.tar.gz |
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.
-rw-r--r-- | tests/unit/geo.tcl | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/tests/unit/geo.tcl b/tests/unit/geo.tcl index 44a0ae1bc..fdbfbf139 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]] |