diff options
author | antirez <antirez@gmail.com> | 2015-06-29 12:44:31 +0200 |
---|---|---|
committer | antirez <antirez@gmail.com> | 2015-06-29 12:44:34 +0200 |
commit | f108c687ad122d76e8468f98934255ffb51cc7e8 (patch) | |
tree | 2160d798dc707eded4409fb2818fbb540e6e71c2 /tests/unit/geo.tcl | |
parent | a12192f5ff33298eb7082cc3f6e2de17957e7d26 (diff) | |
download | redis-f108c687ad122d76e8468f98934255ffb51cc7e8.tar.gz |
Geo: GEODIST and tests.
Diffstat (limited to 'tests/unit/geo.tcl')
-rw-r--r-- | tests/unit/geo.tcl | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/tests/unit/geo.tcl b/tests/unit/geo.tcl index 191f88c58..cf6d8c614 100644 --- a/tests/unit/geo.tcl +++ b/tests/unit/geo.tcl @@ -109,6 +109,28 @@ start_server {tags {"geo"}} { lindex [r geopos points a x b] 1 } {} + test {GEODIST simple & unit} { + r del points + r geoadd points 13.361389 38.115556 "Palermo" \ + 15.087269 37.502669 "Catania" + set m [r geodist points Palermo Catania] + assert {$m > 166274 && $m < 166275} + set km [r geodist points Palermo Catania km] + assert {$km > 166.2 && $km < 166.3} + } + + test {GEODIST missing elements} { + r del points + r geoadd points 13.361389 38.115556 "Palermo" \ + 15.087269 37.502669 "Catania" + set m [r geodist points Palermo Agrigento] + assert {$m eq {}} + set m [r geodist points Ragusa Agrigento] + assert {$m eq {}} + set m [r geodist empty_key Palermo Catania] + assert {$m eq {}} + } + test {GEOADD + GEORANGE randomized test} { set attempt 10 while {[incr attempt -1]} { |