Skip to content

Commit

Permalink
Merge pull request openlayers#1241 from fredj/coordinate_format_tests
Browse files Browse the repository at this point in the history
Add tests for ol.coordinate.format
  • Loading branch information
fredj committed Nov 6, 2013
2 parents ea73388 + 116b107 commit a9e980b
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions test/spec/ol/coordinate.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,23 @@ goog.provide('ol.test.coordinate');

describe('ol.coordinate', function() {

describe('#format', function() {
var coordinate;
beforeEach(function() {
coordinate = [6.6123, 46.7919];
});

it('rounds the values', function() {
var string = ol.coordinate.format(coordinate, '{x} {y}', 0);
expect(string).to.eql('7 47');
});

it('handles the optional fractionDigits param', function() {
var string = ol.coordinate.format(coordinate, '{x} {y}', 3);
expect(string).to.eql('6.612 46.792');
});
});

describe('#closestOnSegment', function() {
it('can handle points where the foot of the perpendicular is closest',
function() {
Expand Down

0 comments on commit a9e980b

Please sign in to comment.