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.js23
1 files changed, 12 insertions, 11 deletions
diff --git a/jstests/core/geo_s2disjoint_holes.js b/jstests/core/geo_s2disjoint_holes.js
index 0b088434b36..dd17dd29b1d 100644
--- a/jstests/core/geo_s2disjoint_holes.js
+++ b/jstests/core/geo_s2disjoint_holes.js
@@ -12,13 +12,14 @@
// 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]]
- ],
+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.
@@ -33,12 +34,12 @@ 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."));
+ 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."));
+ 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.