Parse lat and lon independently when using dms notation

This commit is contained in:
Anton Khorev 2024-07-13 17:40:01 +03:00
parent 392d3d1226
commit 7917a7db80
2 changed files with 22 additions and 7 deletions

View file

@ -261,6 +261,17 @@ class GeocoderControllerTest < ActionDispatch::IntegrationTest
end
end
#
# Test identification of lat/lon pairs with mixed precision
def test_identify_latlon_ne_mixed_precision
latlon_check "N1 5 E15", 1.083333, 15
latlon_check "N1 5 9 E15", 1.085833, 15
latlon_check "N1 5 9 E1 5", 1.085833, 1.083333
latlon_check "N15 E1 5", 15, 1.083333
latlon_check "N15 E1 5 9", 15, 1.085833
latlon_check "N1 5 E1 5 9", 1.083333, 1.085833
end
#
# Test identification of lat/lon pairs with values close to zero
def test_identify_latlon_close_to_zero