Enforces spacing around commas

This commit is contained in:
Frederic Junod
2016-12-14 13:42:47 +01:00
parent b1f25d484b
commit 392cbcc138
15 changed files with 46 additions and 46 deletions
+1 -1
View File
@@ -96,7 +96,7 @@ var collectAndWriteCoverageData = function() {
} }
}); });
reporter.addAll(['lcovonly','html']); reporter.addAll(['lcovonly', 'html']);
revertBackupAndInstrumentationDir(); revertBackupAndInstrumentationDir();
+1 -1
View File
@@ -137,7 +137,7 @@ describe('ol.control.ScaleLine', function() {
expect(renderSpy.callCount).to.be(2); expect(renderSpy.callCount).to.be(2);
done(); done();
}); });
map.getView().setCenter([1,1]); map.getView().setCenter([1, 1]);
}); });
}); });
+2 -2
View File
@@ -175,7 +175,7 @@ describe('ol.format.EsriJSON', function() {
expect(feature).to.be.an(ol.Feature); expect(feature).to.be.an(ol.Feature);
var geometry = feature.getGeometry(); var geometry = feature.getGeometry();
expect(geometry).to.be.an(ol.geom.MultiPoint); expect(geometry).to.be.an(ol.geom.MultiPoint);
expect(geometry.getCoordinates()).to.eql([[102.0, 0.0] , [103.0, 1.0]]); expect(geometry.getCoordinates()).to.eql([[102.0, 0.0], [103.0, 1.0]]);
expect(feature.get('prop0')).to.be('value0'); expect(feature.get('prop0')).to.be('value0');
}); });
@@ -874,7 +874,7 @@ describe('ol.format.EsriJSON', function() {
}); });
it('encodes multipoint', function() { it('encodes multipoint', function() {
var multipoint = new ol.geom.MultiPoint([[102.0, 0.0] , [103.0, 1.0]]); var multipoint = new ol.geom.MultiPoint([[102.0, 0.0], [103.0, 1.0]]);
var esrijson = format.writeGeometry(multipoint); var esrijson = format.writeGeometry(multipoint);
expect(multipoint.getCoordinates()).to.eql( expect(multipoint.getCoordinates()).to.eql(
format.readGeometry(esrijson).getCoordinates()); format.readGeometry(esrijson).getCoordinates());
+1 -1
View File
@@ -809,7 +809,7 @@ describe('ol.format.GeoJSON', function() {
}); });
it('truncates transformed point with decimals option', function() { it('truncates transformed point with decimals option', function() {
var point = new ol.geom.Point([2, 3]).transform('EPSG:4326','EPSG:3857'); var point = new ol.geom.Point([2, 3]).transform('EPSG:4326', 'EPSG:3857');
var geojson = format.writeGeometry(point, { var geojson = format.writeGeometry(point, {
featureProjection: 'EPSG:3857', featureProjection: 'EPSG:3857',
decimals: 2 decimals: 2
+4 -4
View File
@@ -1175,9 +1175,9 @@ describe('ol.format.KML', function() {
it('can write GeometryCollection geometries', function() { it('can write GeometryCollection geometries', function() {
var collection = new ol.geom.GeometryCollection([ var collection = new ol.geom.GeometryCollection([
new ol.geom.Point([1,2]), new ol.geom.Point([1, 2]),
new ol.geom.LineString([[1,2],[3,4]]), new ol.geom.LineString([[1, 2], [3, 4]]),
new ol.geom.Polygon([[[1,2],[3,4],[3,2],[1,2]]]) new ol.geom.Polygon([[[1, 2], [3, 4], [3, 2], [1, 2]]])
]); ]);
var features = [new ol.Feature(collection)]; var features = [new ol.Feature(collection)];
var node = format.writeFeaturesNode(features); var node = format.writeFeaturesNode(features);
@@ -3255,7 +3255,7 @@ describe('ol.format.KML', function() {
expect(nl[0].maxLodPixels).to.be(-1); expect(nl[0].maxLodPixels).to.be(-1);
expect(nl[0].minFadeExtent).to.be(0); expect(nl[0].minFadeExtent).to.be(0);
expect(nl[0].maxFadeExtent).to.be(0); expect(nl[0].maxFadeExtent).to.be(0);
expect(nl[1].extent).to.eql([0,0,180,90]); expect(nl[1].extent).to.eql([0, 0, 180, 90]);
}); });
}); });
}); });
+3 -3
View File
@@ -604,7 +604,7 @@ describe('ol.format.WKT', function() {
expect(polygons[0].getLinearRings().length).to.eql(1); expect(polygons[0].getLinearRings().length).to.eql(1);
expect(polygons[1].getLinearRings().length).to.eql(2); expect(polygons[1].getLinearRings().length).to.eql(2);
expect(polygons[0].getLinearRings()[0].getCoordinates()).to.eql( expect(polygons[0].getLinearRings()[0].getCoordinates()).to.eql(
[[40, 40 , 1], [45, 30, 2], [20, 45, 3], [40, 40, 1]]); [[40, 40, 1], [45, 30, 2], [20, 45, 3], [40, 40, 1]]);
expect(polygons[1].getLinearRings()[0].getCoordinates()).to.eql( expect(polygons[1].getLinearRings()[0].getCoordinates()).to.eql(
[[20, 35, 1], [45, 20, 2], [30, 5, 3], [10, 10, 4], [10, 30, 5], [20, 35, 1]]); [[20, 35, 1], [45, 20, 2], [30, 5, 3], [10, 10, 4], [10, 30, 5], [20, 35, 1]]);
expect(polygons[1].getLinearRings()[1].getCoordinates()).to.eql( expect(polygons[1].getLinearRings()[1].getCoordinates()).to.eql(
@@ -644,7 +644,7 @@ describe('ol.format.WKT', function() {
expect(polygons[0].getLinearRings().length).to.eql(1); expect(polygons[0].getLinearRings().length).to.eql(1);
expect(polygons[1].getLinearRings().length).to.eql(2); expect(polygons[1].getLinearRings().length).to.eql(2);
expect(polygons[0].getLinearRings()[0].getCoordinates()).to.eql( expect(polygons[0].getLinearRings()[0].getCoordinates()).to.eql(
[[40, 40 , 1], [45, 30, 2], [20, 45, 3], [40, 40, 1]]); [[40, 40, 1], [45, 30, 2], [20, 45, 3], [40, 40, 1]]);
expect(polygons[1].getLinearRings()[0].getCoordinates()).to.eql( expect(polygons[1].getLinearRings()[0].getCoordinates()).to.eql(
[[20, 35, 1], [45, 20, 2], [30, 5, 3], [10, 10, 4], [10, 30, 5], [20, 35, 1]]); [[20, 35, 1], [45, 20, 2], [30, 5, 3], [10, 10, 4], [10, 30, 5], [20, 35, 1]]);
expect(polygons[1].getLinearRings()[1].getCoordinates()).to.eql( expect(polygons[1].getLinearRings()[1].getCoordinates()).to.eql(
@@ -684,7 +684,7 @@ describe('ol.format.WKT', function() {
expect(polygons[0].getLinearRings().length).to.eql(1); expect(polygons[0].getLinearRings().length).to.eql(1);
expect(polygons[1].getLinearRings().length).to.eql(2); expect(polygons[1].getLinearRings().length).to.eql(2);
expect(polygons[0].getLinearRings()[0].getCoordinates()).to.eql( expect(polygons[0].getLinearRings()[0].getCoordinates()).to.eql(
[[40, 40 , 1, 0.1], [45, 30, 2, 0.1], [20, 45, 3, 0.1], [40, 40, 1, 0.1]]); [[40, 40, 1, 0.1], [45, 30, 2, 0.1], [20, 45, 3, 0.1], [40, 40, 1, 0.1]]);
expect(polygons[1].getLinearRings()[0].getCoordinates()).to.eql( expect(polygons[1].getLinearRings()[0].getCoordinates()).to.eql(
[[20, 35, 1, 0.1], [45, 20, 2, 0.1], [30, 5, 3, 0.1], [10, 10, 4, 0.1], [10, 30, 5, 0.1], [20, 35, 1, 0.1]]); [[20, 35, 1, 0.1], [45, 20, 2, 0.1], [30, 5, 3, 0.1], [10, 10, 4, 0.1], [10, 30, 5, 0.1], [20, 35, 1, 0.1]]);
expect(polygons[1].getLinearRings()[1].getCoordinates()).to.eql( expect(polygons[1].getLinearRings()[1].getCoordinates()).to.eql(
+1 -1
View File
@@ -8,7 +8,7 @@ describe('getUid()', function() {
}); });
it('generates a strictly increasing sequence', function() { it('generates a strictly increasing sequence', function() {
var a = {} , b = {}, c = {}; var a = {}, b = {}, c = {};
ol.getUid(a); ol.getUid(a);
ol.getUid(c); ol.getUid(c);
ol.getUid(b); ol.getUid(b);
+1 -1
View File
@@ -407,7 +407,7 @@ describe('ol.interaction.Draw', function() {
source: source, source: source,
type: 'LineString', type: 'LineString',
finishCondition: function(event) { finishCondition: function(event) {
if (ol.array.equals(event.coordinate,[30,-20])) { if (ol.array.equals(event.coordinate, [30, -20])) {
return true; return true;
} }
return false; return false;
+15 -15
View File
@@ -74,17 +74,17 @@ describe('ol.interaction.Extent', function() {
} }
describe('snap to vertex', function() { describe('snap to vertex', function() {
it('snap to vertex works', function() { it('snap to vertex works', function() {
interaction.setExtent([-50,-50,50,50]); interaction.setExtent([-50, -50, 50, 50]);
expect(interaction.snapToVertex_([230,40], map)).to.eql([50,50]); expect(interaction.snapToVertex_([230, 40], map)).to.eql([50, 50]);
expect(interaction.snapToVertex_([231,41], map)).to.eql([50,50]); expect(interaction.snapToVertex_([231, 41], map)).to.eql([50, 50]);
}); });
it('snap to edge works', function() { it('snap to edge works', function() {
interaction.setExtent([-50,-50,50,50]); interaction.setExtent([-50, -50, 50, 50]);
expect(interaction.snapToVertex_([230,90], map)).to.eql([50,0]); expect(interaction.snapToVertex_([230, 90], map)).to.eql([50, 0]);
expect(interaction.snapToVertex_([230,89], map)).to.eql([50,1]); expect(interaction.snapToVertex_([230, 89], map)).to.eql([50, 1]);
expect(interaction.snapToVertex_([231,90], map)).to.eql([50,0]); expect(interaction.snapToVertex_([231, 90], map)).to.eql([50, 0]);
}); });
}); });
@@ -95,11 +95,11 @@ describe('ol.interaction.Extent', function() {
simulateEvent('pointerdrag', 50, 50, false, 0); simulateEvent('pointerdrag', 50, 50, false, 0);
simulateEvent('pointerup', 50, 50, false, 0); simulateEvent('pointerup', 50, 50, false, 0);
expect(interaction.getExtent()).to.eql([-50,-50,50,50]); expect(interaction.getExtent()).to.eql([-50, -50, 50, 50]);
}); });
it('clicking off extent nulls extent', function() { it('clicking off extent nulls extent', function() {
interaction.setExtent([-50,-50,50,50]); interaction.setExtent([-50, -50, 50, 50]);
simulateEvent('pointerdown', -10, -10, false, 0); simulateEvent('pointerdown', -10, -10, false, 0);
simulateEvent('pointerup', -10, -10, false, 0); simulateEvent('pointerup', -10, -10, false, 0);
@@ -108,32 +108,32 @@ describe('ol.interaction.Extent', function() {
}); });
it('clicking on extent does not null extent', function() { it('clicking on extent does not null extent', function() {
interaction.setExtent([-50,-50,50,50]); interaction.setExtent([-50, -50, 50, 50]);
simulateEvent('pointerdown', 50, 50, false, 0); simulateEvent('pointerdown', 50, 50, false, 0);
simulateEvent('pointerup', 50, 50, false, 0); simulateEvent('pointerup', 50, 50, false, 0);
expect(interaction.getExtent()).to.eql([-50,-50,50,50]); expect(interaction.getExtent()).to.eql([-50, -50, 50, 50]);
}); });
it('snap and drag vertex works', function() { it('snap and drag vertex works', function() {
interaction.setExtent([-50,-50,50,50]); interaction.setExtent([-50, -50, 50, 50]);
simulateEvent('pointerdown', 51, 49, false, 0); simulateEvent('pointerdown', 51, 49, false, 0);
simulateEvent('pointerdrag', -70, -40, false, 0); simulateEvent('pointerdrag', -70, -40, false, 0);
simulateEvent('pointerup', -70, -40, false, 0); simulateEvent('pointerup', -70, -40, false, 0);
expect(interaction.getExtent()).to.eql([-70,-50,-50,-40]); expect(interaction.getExtent()).to.eql([-70, -50, -50, -40]);
}); });
it('snap and drag edge works', function() { it('snap and drag edge works', function() {
interaction.setExtent([-50,-50,50,50]); interaction.setExtent([-50, -50, 50, 50]);
simulateEvent('pointerdown', 51, 5, false, 0); simulateEvent('pointerdown', 51, 5, false, 0);
simulateEvent('pointerdrag', 20, -30, false, 0); simulateEvent('pointerdrag', 20, -30, false, 0);
simulateEvent('pointerup', 20, -30, false, 0); simulateEvent('pointerup', 20, -30, false, 0);
expect(interaction.getExtent()).to.eql([-50,-50,20,50]); expect(interaction.getExtent()).to.eql([-50, -50, 20, 50]);
}); });
}); });
}); });
+1 -1
View File
@@ -246,7 +246,7 @@ describe('ol.render.canvas.Immediate', function() {
[-80.899323, 29.061249000000004, 0], // lineTo() [-80.899323, 29.061249000000004, 0], // lineTo()
[-80.862663, 28.991361999999995, 0], // lineTo() [-80.862663, 28.991361999999995, 0], // lineTo()
[-80.736061, 28.788576000000006, 0] // closePath() [-80.736061, 28.788576000000006, 0] // closePath()
]],[[ ]], [[
// second polygon // second polygon
[-82.102127, 26.585724, 0], // moveTo() [-82.102127, 26.585724, 0], // moveTo()
[-82.067139, 26.497208, 0], // lineTo() [-82.067139, 26.497208, 0], // lineTo()
@@ -49,7 +49,7 @@ describe('ol.render.webgl.CircleReplay', function() {
describe('#drawCircle', function() { describe('#drawCircle', function() {
it('sets the buffer data', function() { it('sets the buffer data', function() {
var circle = new ol.geom.Circle([0,0], 5000); var circle = new ol.geom.Circle([0, 0], 5000);
replay.setFillStrokeStyle(fillStyle, strokeStyle); replay.setFillStrokeStyle(fillStyle, strokeStyle);
replay.drawCircle(circle, null); replay.drawCircle(circle, null);
@@ -62,7 +62,7 @@ describe('ol.render.webgl.CircleReplay', function() {
}); });
it('does not draw if radius is zero', function() { it('does not draw if radius is zero', function() {
var circle = new ol.geom.Circle([0,0], 0); var circle = new ol.geom.Circle([0, 0], 0);
replay.drawCircle(circle, null); replay.drawCircle(circle, null);
expect(replay.vertices).to.have.length(0); expect(replay.vertices).to.have.length(0);
@@ -72,7 +72,7 @@ describe('ol.render.webgl.CircleReplay', function() {
}); });
it('resets state and removes style if it belongs to a zero radius circle', function() { it('resets state and removes style if it belongs to a zero radius circle', function() {
var circle = new ol.geom.Circle([0,0], 0); var circle = new ol.geom.Circle([0, 0], 0);
replay.setFillStrokeStyle(fillStyle, strokeStyle); replay.setFillStrokeStyle(fillStyle, strokeStyle);
replay.setFillStrokeStyle(null, strokeStyle); replay.setFillStrokeStyle(null, strokeStyle);
+3 -3
View File
@@ -46,7 +46,7 @@ describe('ol.style.Style', function() {
it('copies all values', function() { it('copies all values', function() {
var original = new ol.style.Style({ var original = new ol.style.Style({
geometry: new ol.geom.Point([0,0,0]), geometry: new ol.geom.Point([0, 0, 0]),
fill: new ol.style.Fill({ fill: new ol.style.Fill({
color: '#319FD3' color: '#319FD3'
}), }),
@@ -72,7 +72,7 @@ describe('ol.style.Style', function() {
it('the clone does not reference the same objects as the original', function() { it('the clone does not reference the same objects as the original', function() {
var original = new ol.style.Style({ var original = new ol.style.Style({
geometry: new ol.geom .Point([0,0,0]), geometry: new ol.geom .Point([0, 0, 0]),
fill: new ol.style.Fill({ fill: new ol.style.Fill({
color: '#319FD3' color: '#319FD3'
}), }),
@@ -93,7 +93,7 @@ describe('ol.style.Style', function() {
expect(original.getStroke()).not.to.be(clone.getStroke()); expect(original.getStroke()).not.to.be(clone.getStroke());
expect(original.getText()).not.to.be(clone.getText()); expect(original.getText()).not.to.be(clone.getText());
clone.getGeometry().setCoordinates([1,1,1]); clone.getGeometry().setCoordinates([1, 1, 1]);
clone.getFill().setColor('#012345'); clone.getFill().setColor('#012345');
clone.getImage().setScale(2); clone.getImage().setScale(2);
clone.getStroke().setColor('#012345'); clone.getStroke().setColor('#012345');
+8 -8
View File
@@ -16,15 +16,15 @@ describe('ol.Tile', function() {
tile.interimTile = next; tile.interimTile = next;
return next; return next;
}; };
var tail = addToChain(head,ol.Tile.State.IDLE); //discard, deprecated by head var tail = addToChain(head, ol.Tile.State.IDLE); //discard, deprecated by head
tail = addToChain(tail,ol.Tile.State.LOADING); //keep, request already going tail = addToChain(tail, ol.Tile.State.LOADING); //keep, request already going
tail = addToChain(tail,ol.Tile.State.IDLE); //discard, deprecated by head tail = addToChain(tail, ol.Tile.State.IDLE); //discard, deprecated by head
tail = addToChain(tail,ol.Tile.State.LOADED); //keep, use for rendering tail = addToChain(tail, ol.Tile.State.LOADED); //keep, use for rendering
renderTile = tail; //store this tile for later tests renderTile = tail; //store this tile for later tests
tail = addToChain(tail,ol.Tile.State.IDLE); //rest of list outdated by tile above tail = addToChain(tail, ol.Tile.State.IDLE); //rest of list outdated by tile above
tail = addToChain(tail,ol.Tile.State.LOADED); tail = addToChain(tail, ol.Tile.State.LOADED);
tail = addToChain(tail,ol.Tile.State.LOADING); tail = addToChain(tail, ol.Tile.State.LOADING);
tail = addToChain(tail,ol.Tile.State.LOADED); tail = addToChain(tail, ol.Tile.State.LOADED);
}); });
+1 -1
View File
@@ -593,7 +593,7 @@ describe('ol.View', function() {
view.animate({ view.animate({
resolution: 2000, resolution: 2000,
duration: 25 duration: 25
},{ }, {
resolution: 2, resolution: 2,
duration: 25 duration: 25
}, function() { }, function() {
+1 -1
View File
@@ -299,7 +299,7 @@ describe('ol.rendering.style.Polygon', function() {
function createRainbowGradient() { function createRainbowGradient() {
var canvas = document.createElement('canvas'); var canvas = document.createElement('canvas');
var context = canvas.getContext('2d'); var context = canvas.getContext('2d');
var gradient = context.createLinearGradient(0,0,30,0); var gradient = context.createLinearGradient(0, 0, 30, 0);
gradient.addColorStop(0, 'red'); gradient.addColorStop(0, 'red');
gradient.addColorStop(1 / 6, 'orange'); gradient.addColorStop(1 / 6, 'orange');
gradient.addColorStop(2 / 6, 'yellow'); gradient.addColorStop(2 / 6, 'yellow');