Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@ jobs:
strategy:
fail-fast: false
matrix:
redis: ["7.0", "6.2", "6.0", "5.0"]
redis: ["8.2", "8.0", "7.4", "7.2", "7.0", "6.2", "6.0", "5.0"]
runs-on: ubuntu-latest
env:
LOW_TIMEOUT: "0.14"
Expand Down
22 changes: 19 additions & 3 deletions test/redis/commands_on_geo_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -59,20 +59,36 @@ def test_georadiusbymember_with_options_count_sort
assert_equal [["Palermo", "166.2742"]], city
end

def coordinates_catania
if version >= "8.0"
["15.087267458438873", "37.50266842333162"]
else
["15.08726745843887329", "37.50266842333162032"]
end
end

def coordinates_palermo
if version >= "8.0"
["13.361389338970184", "38.1155563954963"]
else
["13.36138933897018433", "38.11555639549629859"]
end
end

def test_geopos
location = r.geopos("Sicily", "Catania")
assert_equal [["15.08726745843887329", "37.50266842333162032"]], location
assert_equal [coordinates_catania], location

locations = r.geopos("Sicily", ["Palermo", "Catania"])
assert_equal [["13.36138933897018433", "38.11555639549629859"], ["15.08726745843887329", "37.50266842333162032"]], locations
assert_equal [coordinates_palermo, coordinates_catania], locations
end

def test_geopos_nonexistant_location
location = r.geopos("Sicily", "Rome")
assert_equal [nil], location

locations = r.geopos("Sicily", ["Rome", "Catania"])
assert_equal [nil, ["15.08726745843887329", "37.50266842333162032"]], locations
assert_equal [nil, coordinates_catania], locations
end

def test_geodist
Expand Down
3 changes: 3 additions & 0 deletions test/support/conf/redis-7.4.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
appendonly no
save ""
enable-debug-command yes
3 changes: 3 additions & 0 deletions test/support/conf/redis-8.0.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
appendonly no
save ""
enable-debug-command yes
3 changes: 3 additions & 0 deletions test/support/conf/redis-8.2.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
appendonly no
save ""
enable-debug-command yes