From 4ae691e8edc87d0e3cfb633bb91c328426be007b Mon Sep 17 00:00:00 2001 From: Jonathan Abrahams Date: Wed, 9 Mar 2016 12:17:50 -0500 Subject: SERVER-22468 Format JS code with approved style in jstests/ --- jstests/core/geo_oob_sphere.js | 37 ++++++++++++++++++++++--------------- 1 file changed, 22 insertions(+), 15 deletions(-) (limited to 'jstests/core/geo_oob_sphere.js') diff --git a/jstests/core/geo_oob_sphere.js b/jstests/core/geo_oob_sphere.js index 7403cc99610..40249766355 100644 --- a/jstests/core/geo_oob_sphere.js +++ b/jstests/core/geo_oob_sphere.js @@ -5,29 +5,36 @@ t = db.geooobsphere; t.drop(); -t.insert({ loc : { x : 30, y : 89 } }); -t.insert({ loc : { x : 30, y : 89 } }); -t.insert({ loc : { x : 30, y : 89 } }); -t.insert({ loc : { x : 30, y : 89 } }); -t.insert({ loc : { x : 30, y : 89 } }); -t.insert({ loc : { x : 30, y : 89 } }); -t.insert({ loc : { x : 30, y : 91 } }); +t.insert({loc: {x: 30, y: 89}}); +t.insert({loc: {x: 30, y: 89}}); +t.insert({loc: {x: 30, y: 89}}); +t.insert({loc: {x: 30, y: 89}}); +t.insert({loc: {x: 30, y: 89}}); +t.insert({loc: {x: 30, y: 89}}); +t.insert({loc: {x: 30, y: 91}}); -assert.commandWorked(t.ensureIndex({ loc : "2d" })); +assert.commandWorked(t.ensureIndex({loc: "2d"})); -assert.throws( function() { t.find({ loc : { $nearSphere : [ 30, 91 ], $maxDistance : 0.25 } }).count(); } ); +assert.throws(function() { + t.find({loc: {$nearSphere: [30, 91], $maxDistance: 0.25}}).count(); +}); // TODO: SERVER-9986 - it's not clear that throwing is correct behavior here -// assert.throws( function() { t.find({ loc : { $nearSphere : [ 30, 89 ], $maxDistance : 0.25 } }).count() } ); +// assert.throws( function() { t.find({ loc : { $nearSphere : [ 30, 89 ], $maxDistance : 0.25 } +// }).count() } ); -assert.throws( function() { t.find({ loc : { $within : { $centerSphere : [[ -180, -91 ], 0.25] } } }).count(); } ); +assert.throws(function() { + t.find({loc: {$within: {$centerSphere: [[-180, -91], 0.25]}}}).count(); +}); var res; -res = db.runCommand({ geoNear : "geooobsphere", near : [179, -91], maxDistance : 0.25, spherical : true }); -assert.commandFailed( res ); -printjson( res ); +res = + db.runCommand({geoNear: "geooobsphere", near: [179, -91], maxDistance: 0.25, spherical: true}); +assert.commandFailed(res); +printjson(res); // TODO: SERVER-9986 - it's not clear that throwing is correct behavior here -// res = db.runCommand({ geoNear : "geooobsphere", near : [30, 89], maxDistance : 0.25, spherical : true }) +// res = db.runCommand({ geoNear : "geooobsphere", near : [30, 89], maxDistance : 0.25, spherical : +// true }) // assert.commandFailed( res ) // printjson( res ) -- cgit v1.2.1