]> git.openstreetmap.org Git - rails.git/blob - test/lib/osm_test.rb
Merge pull request #6394 from openstreetmap/dependabot/github_actions/ruby/setup...
[rails.git] / test / lib / osm_test.rb
1 # frozen_string_literal: true
2
3 require "test_helper"
4
5 class OsmTest < ActiveSupport::TestCase
6   def test_mercator
7     proj = OSM::Mercator.new(0, 0, 1, 1, 100, 200)
8     assert_in_delta(50, proj.x(0.5), 0.01)
9     assert_in_delta(100, proj.y(0.5), 0.01)
10   end
11
12   def test_mercator_collapsed_bbox
13     proj = OSM::Mercator.new(0, 0, 0, 0, 100, 200)
14     assert_in_delta(50, proj.x(0), 0.01)
15     assert_in_delta(100, proj.y(0), 0.01)
16   end
17 end