Transformed

This commit is contained in:
Tim Schaub
2017-12-11 16:29:33 -07:00
parent 1cdb6a66f0
commit 7f47883c48
737 changed files with 22216 additions and 21609 deletions

View File

@@ -1,14 +1,12 @@
goog.require('ol.extent');
goog.require('ol.geom.LineString');
import _ol_extent_ from '../../../../src/ol/extent.js';
import _ol_geom_LineString_ from '../../../../src/ol/geom/LineString.js';
describe('ol.geom.LineString', function() {
it('can be constructed with a null geometry', function() {
expect(function() {
return new ol.geom.LineString(null);
return new _ol_geom_LineString_(null);
}).not.to.throwException();
});
@@ -16,7 +14,7 @@ describe('ol.geom.LineString', function() {
var lineString;
beforeEach(function() {
lineString = new ol.geom.LineString([]);
lineString = new _ol_geom_LineString_([]);
});
it('defaults to layout XY', function() {
@@ -28,7 +26,7 @@ describe('ol.geom.LineString', function() {
});
it('has an empty extent', function() {
expect(ol.extent.isEmpty(lineString.getExtent())).to.be(true);
expect(_ol_extent_.isEmpty(lineString.getExtent())).to.be(true);
});
it('has empty flat coordinates', function() {
@@ -52,7 +50,7 @@ describe('ol.geom.LineString', function() {
var lineString;
beforeEach(function() {
lineString = new ol.geom.LineString([[1, 2], [3, 4]]);
lineString = new _ol_geom_LineString_([[1, 2], [3, 4]]);
});
it('has the expected layout', function() {
@@ -113,7 +111,7 @@ describe('ol.geom.LineString', function() {
var lineString;
beforeEach(function() {
lineString = new ol.geom.LineString([[1, 2, 3], [4, 5, 6]]);
lineString = new _ol_geom_LineString_([[1, 2, 3], [4, 5, 6]]);
});
it('has the expected layout', function() {
@@ -158,7 +156,7 @@ describe('ol.geom.LineString', function() {
var lineString;
beforeEach(function() {
lineString = new ol.geom.LineString(
lineString = new _ol_geom_LineString_(
[[1, 2, 3], [4, 5, 6]], 'XYM');
});
@@ -204,7 +202,7 @@ describe('ol.geom.LineString', function() {
var lineString;
beforeEach(function() {
lineString = new ol.geom.LineString([[1, 2, 3, 4], [5, 6, 7, 8]]);
lineString = new _ol_geom_LineString_([[1, 2, 3, 4], [5, 6, 7, 8]]);
});
it('has the expected layout', function() {
@@ -248,21 +246,21 @@ describe('ol.geom.LineString', function() {
describe('#scale()', function() {
it('scales a linestring', function() {
var geom = new ol.geom.LineString([[-10, -20], [10, 20]]);
var geom = new _ol_geom_LineString_([[-10, -20], [10, 20]]);
geom.scale(10);
var coordinates = geom.getCoordinates();
expect(coordinates).to.eql([[-100, -200], [100, 200]]);
});
it('accepts sx and sy', function() {
var geom = new ol.geom.LineString([[-10, -20], [10, 20]]);
var geom = new _ol_geom_LineString_([[-10, -20], [10, 20]]);
geom.scale(2, 3);
var coordinates = geom.getCoordinates();
expect(coordinates).to.eql([[-20, -60], [20, 60]]);
});
it('accepts an anchor', function() {
var geom = new ol.geom.LineString([[-10, -20], [10, 20]]);
var geom = new _ol_geom_LineString_([[-10, -20], [10, 20]]);
geom.scale(3, 2, [10, 20]);
var coordinates = geom.getCoordinates();
expect(coordinates).to.eql([[-50, -60], [10, 20]]);
@@ -274,7 +272,7 @@ describe('ol.geom.LineString', function() {
var lineString;
beforeEach(function() {
lineString = new ol.geom.LineString(
lineString = new _ol_geom_LineString_(
[[0, 0], [1.5, 1], [3, 3], [5, 1], [6, 3.5], [7, 5]]);
});
@@ -310,7 +308,7 @@ describe('ol.geom.LineString', function() {
it('returns a simplified geometry', function() {
var simplified = lineString.simplify(1);
expect(simplified).to.be.an(ol.geom.LineString);
expect(simplified).to.be.an(_ol_geom_LineString_);
expect(simplified.getCoordinates()).to.eql(
[[0, 0], [3, 3], [5, 1], [7, 5]]);
});
@@ -333,7 +331,7 @@ describe('ol.geom.LineString', function() {
it('returns the expectedResult', function() {
var simplifiedGeometry = lineString.getSimplifiedGeometry(1);
expect(simplifiedGeometry).to.be.an(ol.geom.LineString);
expect(simplifiedGeometry).to.be.an(_ol_geom_LineString_);
expect(simplifiedGeometry.getCoordinates()).to.eql(
[[0, 0], [3, 3], [5, 1], [7, 5]]);
});
@@ -386,7 +384,7 @@ describe('ol.geom.LineString', function() {
var lineString;
beforeEach(function() {
lineString = new ol.geom.LineString(
lineString = new _ol_geom_LineString_(
[[1, 2, 3], [4, 5, 6]], 'XYM');
});
@@ -415,7 +413,7 @@ describe('ol.geom.LineString', function() {
var lineString;
beforeEach(function() {
lineString = new ol.geom.LineString([
lineString = new _ol_geom_LineString_([
[0, 0, 0, 0],
[1, -1, 2, 1],
[2, -2, 4, 2],