summaryrefslogtreecommitdiff
path: root/jstests/core/geo_s2disjoint_holes.js
diff options
context:
space:
mode:
Diffstat (limited to 'jstests/core/geo_s2disjoint_holes.js')
-rw-r--r--jstests/core/geo_s2disjoint_holes.js40
1 files changed, 17 insertions, 23 deletions
diff --git a/jstests/core/geo_s2disjoint_holes.js b/jstests/core/geo_s2disjoint_holes.js
index bb6b8a4ef2c..a3988e9a614 100644
--- a/jstests/core/geo_s2disjoint_holes.js
+++ b/jstests/core/geo_s2disjoint_holes.js
@@ -8,17 +8,17 @@
// http://geojson.org/geojson-spec.html#polygon
//
-var t = db.geo_s2disjoint_holes,
- coordinates = [
- // One square.
- [[9, 9], [9, 11], [11, 11], [11, 9], [9, 9]],
- // Another disjoint square.
- [[0, 0], [0, 1], [1, 1], [1, 0], [0, 0]]
- ],
- poly = {
- type: 'Polygon',
- coordinates: coordinates
- },
+var t = db.geo_s2disjoint_holes, coordinates = [
+ // One square.
+ [[9, 9], [9, 11], [11, 11], [11, 9], [9, 9]],
+ // Another disjoint square.
+ [[0, 0], [0, 1], [1, 1], [1, 0], [0, 0]]
+],
+ poly =
+ {
+ type: 'Polygon',
+ coordinates: coordinates
+ },
multiPoly = {
type: 'MultiPolygon',
// Multi-polygon's coordinates are wrapped in one more array.
@@ -32,19 +32,13 @@ jsTest.log("We're going to print some error messages, don't be alarmed.");
//
// Can't query with a polygon or multi-polygon that has a non-contained hole.
//
-print(assert.throws(
- function() {
- t.findOne({geo: {$geoWithin: {$geometry: poly}}});
- },
- [],
- "parsing a polygon with non-overlapping holes."));
+print(assert.throws(function() {
+ t.findOne({geo: {$geoWithin: {$geometry: poly}}});
+}, [], "parsing a polygon with non-overlapping holes."));
-print(assert.throws(
- function() {
- t.findOne({geo: {$geoWithin: {$geometry: multiPoly}}});
- },
- [],
- "parsing a multi-polygon with non-overlapping holes."));
+print(assert.throws(function() {
+ t.findOne({geo: {$geoWithin: {$geometry: multiPoly}}});
+}, [], "parsing a multi-polygon with non-overlapping holes."));
//
// Can't insert a bad polygon or a bad multi-polygon with a 2dsphere index.