Address TODOs

To make sure that our binarySearch implementation meets the requirements of
the library, I added more tests for ol.geom.flat.interpolate.lineString, only
to find out that it does not handle line strings with repeated vertices
properly, regardless of what binarySearch implementation is used.
This commit is contained in:
Andreas Hocevar
2016-02-02 23:17:18 +01:00
committed by Nicholas L
parent 1771df0109
commit ebc98ec1bb
3 changed files with 146 additions and 17 deletions

View File

@@ -27,6 +27,13 @@ describe('ol.geom.flat.interpolate', function() {
expect(point).to.eql([2, 3]);
});
xit('also when vertices are repeated', function() {
var flatCoordinates = [0, 1, 2, 3, 2, 3, 4, 5];
var point = ol.geom.flat.interpolate.lineString(
flatCoordinates, 0, 6, 2, 0.5);
expect(point).to.eql([2, 3]);
});
it('returns the expected value when the midpoint falls halfway between ' +
'two existing coordinates',
function() {
@@ -36,6 +43,13 @@ describe('ol.geom.flat.interpolate', function() {
expect(point).to.eql([3, 4]);
});
xit('also when vertices are repeated', function() {
var flatCoordinates = [0, 1, 2, 3, 2, 3, 4, 5, 6, 7];
var point = ol.geom.flat.interpolate.lineString(
flatCoordinates, 0, 8, 2, 0.5);
expect(point).to.eql([3, 4]);
});
it('returns the expected value when the coordinates are not evenly spaced',
function() {
var flatCoordinates = [0, 1, 2, 3, 6, 7];
@@ -44,6 +58,14 @@ describe('ol.geom.flat.interpolate', function() {
expect(point).to.eql([3, 4]);
});
xit('also when vertices are repeated',
function() {
var flatCoordinates = [0, 1, 2, 3, 2, 3, 6, 7];
var point = ol.geom.flat.interpolate.lineString(
flatCoordinates, 0, 6, 2, 0.5);
expect(point).to.eql([3, 4]);
});
it('returns the expected value when using opt_dest',
function() {
var flatCoordinates = [0, 1, 2, 3, 6, 7];