summaryrefslogtreecommitdiff
path: root/tests/unit/geo.tcl
diff options
context:
space:
mode:
Diffstat (limited to 'tests/unit/geo.tcl')
-rw-r--r--tests/unit/geo.tcl17
1 files changed, 17 insertions, 0 deletions
diff --git a/tests/unit/geo.tcl b/tests/unit/geo.tcl
index c67334936..191f88c58 100644
--- a/tests/unit/geo.tcl
+++ b/tests/unit/geo.tcl
@@ -92,6 +92,23 @@ start_server {tags {"geo"}} {
lindex [r geohash points test] 0
} {ezs42e44yx0}
+ test {GEOPOS simple} {
+ r del points
+ r geoadd points 10 20 a 30 40 b
+ lassign [lindex [r geopos points a b] 0] x1 y1
+ lassign [lindex [r geopos points a b] 1] x2 y2
+ assert {abs($x1 - 10) < 0.001}
+ assert {abs($y1 - 20) < 0.001}
+ assert {abs($x2 - 30) < 0.001}
+ assert {abs($y2 - 40) < 0.001}
+ }
+
+ test {GEOPOS missing element} {
+ r del points
+ r geoadd points 10 20 a 30 40 b
+ lindex [r geopos points a x b] 1
+ } {}
+
test {GEOADD + GEORANGE randomized test} {
set attempt 10
while {[incr attempt -1]} {