Provides for tests
This commit is contained in:
@@ -1,3 +1,5 @@
|
|||||||
|
goog.provide('ol.test.geom.LineString');
|
||||||
|
|
||||||
describe('ol.geom.LineString', function() {
|
describe('ol.geom.LineString', function() {
|
||||||
|
|
||||||
describe('constructor', function() {
|
describe('constructor', function() {
|
||||||
@@ -60,3 +62,4 @@ describe('ol.geom.LineString', function() {
|
|||||||
|
|
||||||
});
|
});
|
||||||
|
|
||||||
|
goog.require('ol.geom.LineString');
|
||||||
|
|||||||
@@ -1,11 +1,13 @@
|
|||||||
|
goog.provide('ol.test.geom.MultiLineString');
|
||||||
|
|
||||||
describe('ol.geom.MultiLineString', function() {
|
describe('ol.geom.MultiLineString', function() {
|
||||||
|
|
||||||
describe('constructor', function() {
|
describe('constructor', function() {
|
||||||
|
|
||||||
it('creates a multi-linestring from an array', function() {
|
it('creates a multi-linestring from an array', function() {
|
||||||
var multi = new ol.geom.MultiLineString([
|
var multi = new ol.geom.MultiLineString([
|
||||||
[[10, 20], [30, 40]],
|
[[10, 20], [30, 40]],
|
||||||
[[20, 30], [40, 50]]]);
|
[[20, 30], [40, 50]]]);
|
||||||
expect(multi).toBeA(ol.geom.MultiLineString);
|
expect(multi).toBeA(ol.geom.MultiLineString);
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -21,8 +23,8 @@ describe('ol.geom.MultiLineString', function() {
|
|||||||
|
|
||||||
it('is an array of linestrings', function() {
|
it('is an array of linestrings', function() {
|
||||||
var multi = new ol.geom.MultiLineString([
|
var multi = new ol.geom.MultiLineString([
|
||||||
[[10, 20], [30, 40]],
|
[[10, 20], [30, 40]],
|
||||||
[[20, 30], [40, 50]]]);
|
[[20, 30], [40, 50]]]);
|
||||||
|
|
||||||
expect(multi.components.length).toBe(2);
|
expect(multi.components.length).toBe(2);
|
||||||
expect(multi.components[0]).toBeA(ol.geom.LineString);
|
expect(multi.components[0]).toBeA(ol.geom.LineString);
|
||||||
@@ -36,15 +38,15 @@ describe('ol.geom.MultiLineString', function() {
|
|||||||
|
|
||||||
it('can be 2', function() {
|
it('can be 2', function() {
|
||||||
var multi = new ol.geom.MultiLineString([
|
var multi = new ol.geom.MultiLineString([
|
||||||
[[10, 20], [30, 40]],
|
[[10, 20], [30, 40]],
|
||||||
[[20, 30], [40, 50]]]);
|
[[20, 30], [40, 50]]]);
|
||||||
expect(multi.dimension).toBe(2);
|
expect(multi.dimension).toBe(2);
|
||||||
});
|
});
|
||||||
|
|
||||||
it('can be 3', function() {
|
it('can be 3', function() {
|
||||||
var multi = new ol.geom.MultiLineString([
|
var multi = new ol.geom.MultiLineString([
|
||||||
[[10, 20, 30], [30, 40, 50]],
|
[[10, 20, 30], [30, 40, 50]],
|
||||||
[[20, 30, 40], [40, 50, 60]]]);
|
[[20, 30, 40], [40, 50, 60]]]);
|
||||||
expect(multi.dimension).toBe(3);
|
expect(multi.dimension).toBe(3);
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -54,8 +56,8 @@ describe('ol.geom.MultiLineString', function() {
|
|||||||
|
|
||||||
it('returns the bounding extent', function() {
|
it('returns the bounding extent', function() {
|
||||||
var multi = new ol.geom.MultiLineString([
|
var multi = new ol.geom.MultiLineString([
|
||||||
[[10, 20], [30, 40]],
|
[[10, 20], [30, 40]],
|
||||||
[[20, 30], [40, 50]]]);
|
[[20, 30], [40, 50]]]);
|
||||||
var bounds = multi.getBounds();
|
var bounds = multi.getBounds();
|
||||||
expect(bounds.minX).toBe(10);
|
expect(bounds.minX).toBe(10);
|
||||||
expect(bounds.minY).toBe(20);
|
expect(bounds.minY).toBe(20);
|
||||||
@@ -67,3 +69,4 @@ describe('ol.geom.MultiLineString', function() {
|
|||||||
|
|
||||||
});
|
});
|
||||||
|
|
||||||
|
goog.require('ol.geom.MultiLineString');
|
||||||
|
|||||||
@@ -1,3 +1,5 @@
|
|||||||
|
goog.provide('ol.test.geom.MultiPoint');
|
||||||
|
|
||||||
describe('ol.geom.MultiPoint', function() {
|
describe('ol.geom.MultiPoint', function() {
|
||||||
|
|
||||||
describe('constructor', function() {
|
describe('constructor', function() {
|
||||||
@@ -57,3 +59,4 @@ describe('ol.geom.MultiPoint', function() {
|
|||||||
|
|
||||||
});
|
});
|
||||||
|
|
||||||
|
goog.require('ol.geom.MultiPoint');
|
||||||
|
|||||||
@@ -1,3 +1,5 @@
|
|||||||
|
goog.provide('ol.test.geom.MultiPolygon');
|
||||||
|
|
||||||
describe('ol.geom.MultiPolygon', function() {
|
describe('ol.geom.MultiPolygon', function() {
|
||||||
|
|
||||||
var outer1 = [[0, 0], [10, 0], [10, 10], [0, 10], [0, 0]],
|
var outer1 = [[0, 0], [10, 0], [10, 10], [0, 10], [0, 0]],
|
||||||
@@ -9,8 +11,8 @@ describe('ol.geom.MultiPolygon', function() {
|
|||||||
|
|
||||||
it('creates a multi-linestring from an array', function() {
|
it('creates a multi-linestring from an array', function() {
|
||||||
var multi = new ol.geom.MultiPolygon([
|
var multi = new ol.geom.MultiPolygon([
|
||||||
[outer1, inner1a, inner1b],
|
[outer1, inner1a, inner1b],
|
||||||
[outer2]]);
|
[outer2]]);
|
||||||
expect(multi).toBeA(ol.geom.MultiPolygon);
|
expect(multi).toBeA(ol.geom.MultiPolygon);
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -26,8 +28,8 @@ describe('ol.geom.MultiPolygon', function() {
|
|||||||
|
|
||||||
it('is an array of polygons', function() {
|
it('is an array of polygons', function() {
|
||||||
var multi = new ol.geom.MultiPolygon([
|
var multi = new ol.geom.MultiPolygon([
|
||||||
[outer1, inner1a, inner1b],
|
[outer1, inner1a, inner1b],
|
||||||
[outer2]]);
|
[outer2]]);
|
||||||
|
|
||||||
expect(multi.components.length).toBe(2);
|
expect(multi.components.length).toBe(2);
|
||||||
expect(multi.components[0]).toBeA(ol.geom.Polygon);
|
expect(multi.components[0]).toBeA(ol.geom.Polygon);
|
||||||
@@ -41,8 +43,8 @@ describe('ol.geom.MultiPolygon', function() {
|
|||||||
|
|
||||||
it('can be 2', function() {
|
it('can be 2', function() {
|
||||||
var multi = new ol.geom.MultiPolygon([
|
var multi = new ol.geom.MultiPolygon([
|
||||||
[outer1, inner1a, inner1b],
|
[outer1, inner1a, inner1b],
|
||||||
[outer2]]);
|
[outer2]]);
|
||||||
expect(multi.dimension).toBe(2);
|
expect(multi.dimension).toBe(2);
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -57,8 +59,8 @@ describe('ol.geom.MultiPolygon', function() {
|
|||||||
|
|
||||||
it('returns the bounding extent', function() {
|
it('returns the bounding extent', function() {
|
||||||
var multi = new ol.geom.MultiPolygon([
|
var multi = new ol.geom.MultiPolygon([
|
||||||
[outer1, inner1a, inner1b],
|
[outer1, inner1a, inner1b],
|
||||||
[outer2]]);
|
[outer2]]);
|
||||||
var bounds = multi.getBounds();
|
var bounds = multi.getBounds();
|
||||||
expect(bounds.minX).toBe(0);
|
expect(bounds.minX).toBe(0);
|
||||||
expect(bounds.minY).toBe(0);
|
expect(bounds.minY).toBe(0);
|
||||||
@@ -70,3 +72,4 @@ describe('ol.geom.MultiPolygon', function() {
|
|||||||
|
|
||||||
});
|
});
|
||||||
|
|
||||||
|
goog.require('ol.geom.MultiPolygon');
|
||||||
|
|||||||
@@ -1,3 +1,5 @@
|
|||||||
|
goog.provide('ol.test.geom.Point');
|
||||||
|
|
||||||
describe('ol.geom.Point', function() {
|
describe('ol.geom.Point', function() {
|
||||||
|
|
||||||
describe('constructor', function() {
|
describe('constructor', function() {
|
||||||
@@ -58,3 +60,4 @@ describe('ol.geom.Point', function() {
|
|||||||
|
|
||||||
});
|
});
|
||||||
|
|
||||||
|
goog.require('ol.geom.Point');
|
||||||
|
|||||||
@@ -1,3 +1,5 @@
|
|||||||
|
gooog.require('ol.test.geom.Polygon');
|
||||||
|
|
||||||
describe('ol.geom.Polygon', function() {
|
describe('ol.geom.Polygon', function() {
|
||||||
|
|
||||||
var outer = [[0, 0], [10, 0], [10, 10], [0, 10], [0, 0]],
|
var outer = [[0, 0], [10, 0], [10, 10], [0, 10], [0, 0]],
|
||||||
@@ -62,3 +64,4 @@ describe('ol.geom.Polygon', function() {
|
|||||||
|
|
||||||
});
|
});
|
||||||
|
|
||||||
|
goog.require('ol.geom.Polygon');
|
||||||
|
|||||||
Reference in New Issue
Block a user