pelias / api

HTTP API for Pelias Geocoder
http://pelias.io
MIT License
218 stars 162 forks source link

Incorrect Unit Test #1671

Closed ClancyWalters closed 4 months ago

ClancyWalters commented 4 months ago

Describe the bug There is an incorrect unit test in test/unit/sanitizer/wrap.js. The error was in the original source and has been copied into this project.

In the latitude_negative function you have the test

test('positive latitude wrapping - 721 degrees', function (t) {
  var norm = wrap(721, 0);
  t.equal(norm.lat, 1);
  t.equal(norm.lon, 0);
  t.end();
});

This test has been copied from latitude_positive however the original author simply forgot to adjust the values. Correct values should be

  test('negative latitude wrapping - 721 degrees', function (t) {
    var norm = wrap(-721, 0);
    t.equal(norm.lat, -1);
    t.equal(norm.lon, 0);
    t.end();
  });

Steps to Reproduce

N/A

Expected behavior

N/A

Environment (please complete the following information):

N/A

Pastebin/Screenshots

N/A

Additional context

References

N/A