Skip to content
Merged
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
43 changes: 36 additions & 7 deletions cluster/test/commands_on_geo_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,20 @@ def test_geohash

def test_geopos
add_sicily
expected = [%w[13.36138933897018433 38.11555639549629859],
%w[15.08726745843887329 37.50266842333162032],
nil]

expected = if version >= "8.0"
[
%w[13.361389338970184 38.1155563954963],
%w[15.087267458438873 37.50266842333162],
nil,
]
else
[
%w[13.36138933897018433 38.11555639549629859],
%w[15.08726745843887329 37.50266842333162032],
nil,
]
end
assert_equal expected, redis.geopos('Sicily', %w[Palermo Catania NonExisting])
end

Expand All @@ -43,12 +54,30 @@ def test_georadius
expected = [%w[Palermo 190.4424], %w[Catania 56.4413]]
assert_equal expected, redis.georadius('Sicily', 15, 37, 200, 'km', 'WITHDIST')

expected = [['Palermo', %w[13.36138933897018433 38.11555639549629859]],
['Catania', %w[15.08726745843887329 37.50266842333162032]]]
expected = if version >= "8.0"
[
['Palermo', %w[13.361389338970184 38.1155563954963]],
['Catania', %w[15.087267458438873 37.50266842333162]],
]
else
[
['Palermo', %w[13.36138933897018433 38.11555639549629859]],
['Catania', %w[15.08726745843887329 37.50266842333162032]],
]
end
assert_equal expected, redis.georadius('Sicily', 15, 37, 200, 'km', 'WITHCOORD')

expected = [['Palermo', '190.4424', %w[13.36138933897018433 38.11555639549629859]],
['Catania', '56.4413', %w[15.08726745843887329 37.50266842333162032]]]
expected = if version >= "8.0"
[
['Palermo', '190.4424', %w[13.361389338970184 38.1155563954963]],
['Catania', '56.4413', %w[15.087267458438873 37.50266842333162]],
]
else
[
['Palermo', '190.4424', %w[13.36138933897018433 38.11555639549629859]],
['Catania', '56.4413', %w[15.08726745843887329 37.50266842333162032]],
]
end
assert_equal expected, redis.georadius('Sicily', 15, 37, 200, 'km', 'WITHDIST', 'WITHCOORD')
end

Expand Down