Named exports from ol/geom/flat/topology

This commit is contained in:
Frederic Junod
2018-01-26 15:35:14 +01:00
parent 135f713236
commit 297fd14507
3 changed files with 11 additions and 15 deletions
@@ -1,4 +1,4 @@
import _ol_geom_flat_topology_ from '../../../../../src/ol/geom/flat/topology.js';
import {lineStringIsClosed} from '../../../../../src/ol/geom/flat/topology.js';
describe('ol.geom.flat.topology', function() {
@@ -6,23 +6,23 @@ describe('ol.geom.flat.topology', function() {
it('identifies closed lines aka boundaries', function() {
const flatCoordinates = [0, 0, 3, 0, 0, 3, 0, 0];
const isClosed = _ol_geom_flat_topology_.lineStringIsClosed(flatCoordinates, 0, flatCoordinates.length, 2);
const isClosed = lineStringIsClosed(flatCoordinates, 0, flatCoordinates.length, 2);
expect(isClosed).to.be(true);
});
it('identifies regular linestrings', function() {
const flatCoordinates = [0, 0, 3, 0, 0, 3, 5, 2];
const isClosed = _ol_geom_flat_topology_.lineStringIsClosed(flatCoordinates, 0, flatCoordinates.length, 2);
const isClosed = lineStringIsClosed(flatCoordinates, 0, flatCoordinates.length, 2);
expect(isClosed).to.be(false);
});
it('identifies degenerate boundaries', function() {
let flatCoordinates = [0, 0, 3, 0, 0, 0];
let isClosed = _ol_geom_flat_topology_.lineStringIsClosed(flatCoordinates, 0, flatCoordinates.length, 2);
let isClosed = lineStringIsClosed(flatCoordinates, 0, flatCoordinates.length, 2);
expect(isClosed).to.be(false);
flatCoordinates = [0, 0, 1, 1, 3, 3, 5, 5, 0, 0];
isClosed = _ol_geom_flat_topology_.lineStringIsClosed(flatCoordinates, 0, flatCoordinates.length, 2);
isClosed = lineStringIsClosed(flatCoordinates, 0, flatCoordinates.length, 2);
expect(isClosed).to.be(false);
});