diff options
author | Mike Grundy <michael.grundy@10gen.com> | 2016-02-04 12:29:01 -0500 |
---|---|---|
committer | Mike Grundy <michael.grundy@10gen.com> | 2016-02-09 13:41:02 -0500 |
commit | 3bed8596d18275d1561e4f44f1f0bd72c1e038f1 (patch) | |
tree | 788eaed3c7a692a424f080d16a8841dc8afa3c13 /jstests/core/geo_max.js | |
parent | 985e2a0be95709ac064c57f0a9bb385a55937285 (diff) | |
download | mongo-3bed8596d18275d1561e4f44f1f0bd72c1e038f1.tar.gz |
SERVER-22341 fix jslint errors in jstests/core with eslint --fix
Conflicts:
jstests/core/count_hint.js
Diffstat (limited to 'jstests/core/geo_max.js')
-rw-r--r-- | jstests/core/geo_max.js | 54 |
1 files changed, 27 insertions, 27 deletions
diff --git a/jstests/core/geo_max.js b/jstests/core/geo_max.js index 70fde0c35ec..1dcbf39c907 100644 --- a/jstests/core/geo_max.js +++ b/jstests/core/geo_max.js @@ -3,49 +3,49 @@ // If there aren't enough points the test passes even if the code is broken. load("jstests/libs/geo_near_random.js"); -var test = new GeoNearRandomTest("geo_near_max") +var test = new GeoNearRandomTest("geo_near_max"); test.insertPts(/*numPts*/1000, /*indexBounds*/{min:-180, max:180}, /*scale*/0.9); -test.t.insert({loc: [ 180, 0]}) -test.t.insert({loc: [-180, 0]}) -test.t.insert({loc: [ 179.999, 0]}) -test.t.insert({loc: [-179.999, 0]}) +test.t.insert({loc: [ 180, 0]}); +test.t.insert({loc: [-180, 0]}); +test.t.insert({loc: [ 179.999, 0]}); +test.t.insert({loc: [-179.999, 0]}); -assertXIsNegative = function(obj) { assert.lt(obj.loc[0], 0); } -assertXIsPositive = function(obj) { assert.gt(obj.loc[0], 0); } +assertXIsNegative = function(obj) { assert.lt(obj.loc[0], 0); }; +assertXIsPositive = function(obj) { assert.gt(obj.loc[0], 0); }; -assert.eq(test.t.count({loc:{$within: {$center:[[ 180, 0], 1]}}}), 2) -assert.eq(test.t.count({loc:{$within: {$center:[[-180, 0], 1]}}}), 2) -test.t.find({loc:{$within: {$center:[[ 180, 0], 1]}}}).forEach(assertXIsPositive) -test.t.find({loc:{$within: {$center:[[-180, 0], 1]}}}).forEach(assertXIsNegative) +assert.eq(test.t.count({loc:{$within: {$center:[[ 180, 0], 1]}}}), 2); +assert.eq(test.t.count({loc:{$within: {$center:[[-180, 0], 1]}}}), 2); +test.t.find({loc:{$within: {$center:[[ 180, 0], 1]}}}).forEach(assertXIsPositive); +test.t.find({loc:{$within: {$center:[[-180, 0], 1]}}}).forEach(assertXIsNegative); var oneDegree = Math.PI / 180; // in radians // errors out due to SERVER-1760 if (0) { -assert.eq(test.t.count({loc:{$within: {$centerSphere:[[ 180, 0], oneDegree]}}}), 2) -assert.eq(test.t.count({loc:{$within: {$centerSphere:[[-180, 0], oneDegree]}}}), 2) -test.t.find({loc:{$within: {$centerSphere:[[ 180, 0], oneDegree]}}}).forEach(assertXIsPositive) -test.t.find({loc:{$within: {$centerSphere:[[-180, 0], oneDegree]}}}).forEach(assertXIsNegative) +assert.eq(test.t.count({loc:{$within: {$centerSphere:[[ 180, 0], oneDegree]}}}), 2); +assert.eq(test.t.count({loc:{$within: {$centerSphere:[[-180, 0], oneDegree]}}}), 2); +test.t.find({loc:{$within: {$centerSphere:[[ 180, 0], oneDegree]}}}).forEach(assertXIsPositive); +test.t.find({loc:{$within: {$centerSphere:[[-180, 0], oneDegree]}}}).forEach(assertXIsNegative); } -assert.eq(test.t.count({loc:{$within: {$box:[[ 180, 0.1], [ 179, -0.1]]}}}), 2) -assert.eq(test.t.count({loc:{$within: {$box:[[-180, 0.1], [-179, -0.1]]}}}), 2) -test.t.find({loc:{$within: {$box:[[ 180, 0.1], [ 179, -0.1]]}}}).forEach(assertXIsPositive) -test.t.find({loc:{$within: {$box:[[-180, 0.1], [-179, -0.1]]}}}).forEach(assertXIsNegative) +assert.eq(test.t.count({loc:{$within: {$box:[[ 180, 0.1], [ 179, -0.1]]}}}), 2); +assert.eq(test.t.count({loc:{$within: {$box:[[-180, 0.1], [-179, -0.1]]}}}), 2); +test.t.find({loc:{$within: {$box:[[ 180, 0.1], [ 179, -0.1]]}}}).forEach(assertXIsPositive); +test.t.find({loc:{$within: {$box:[[-180, 0.1], [-179, -0.1]]}}}).forEach(assertXIsNegative); -assert.eq(test.t.count({loc:{$within: {$polygon:[[ 180, 0], [ 179, 0], [ 179.5, 0.5]]}}}), 2) -assert.eq(test.t.count({loc:{$within: {$polygon:[[-180, 0], [-179, 0], [ 179.5, 0.5]]}}}), 2) -test.t.find({loc:{$within: {$polygon:[[ 180, 0], [ 179, 0], [ 179.5, 0.5]]}}}).forEach(assertXIsPositive) -test.t.find({loc:{$within: {$polygon:[[-180, 0], [-179, 0], [ 179.5, 0.5]]}}}).forEach(assertXIsNegative) +assert.eq(test.t.count({loc:{$within: {$polygon:[[ 180, 0], [ 179, 0], [ 179.5, 0.5]]}}}), 2); +assert.eq(test.t.count({loc:{$within: {$polygon:[[-180, 0], [-179, 0], [ 179.5, 0.5]]}}}), 2); +test.t.find({loc:{$within: {$polygon:[[ 180, 0], [ 179, 0], [ 179.5, 0.5]]}}}).forEach(assertXIsPositive); +test.t.find({loc:{$within: {$polygon:[[-180, 0], [-179, 0], [ 179.5, 0.5]]}}}).forEach(assertXIsNegative); -assert.eq(test.t.find({loc:{$near:[ 180, 0]}}, {_id:0}).limit(2).toArray(), [{loc: [ 180, 0]}, {loc: [ 179.999, 0]}]) -assert.eq(test.t.find({loc:{$near:[-180, 0]}}, {_id:0}).limit(2).toArray(), [{loc: [-180, 0]}, {loc: [-179.999, 0]}]) +assert.eq(test.t.find({loc:{$near:[ 180, 0]}}, {_id:0}).limit(2).toArray(), [{loc: [ 180, 0]}, {loc: [ 179.999, 0]}]); +assert.eq(test.t.find({loc:{$near:[-180, 0]}}, {_id:0}).limit(2).toArray(), [{loc: [-180, 0]}, {loc: [-179.999, 0]}]); // These will need to change when SERVER-1760 is fixed printjson(test.t.find({loc:{$nearSphere:[ 180, 0]}}, {_id:0}).limit(2).explain()); -assert.eq(test.t.find({loc:{$nearSphere:[ 180, 0]}}, {_id:0}).limit(2).toArray(), [{loc: [ 180, 0]}, {loc: [ 179.999, 0]}]) +assert.eq(test.t.find({loc:{$nearSphere:[ 180, 0]}}, {_id:0}).limit(2).toArray(), [{loc: [ 180, 0]}, {loc: [ 179.999, 0]}]); printjson(test.t.find({loc:{$nearSphere:[-180, 0]}}, {_id:0}).limit(2).explain()); -assert.eq(test.t.find({loc:{$nearSphere:[-180, 0]}}, {_id:0}).limit(2).toArray(), [{loc: [-180, 0]}, {loc: [-179.999, 0]}]) +assert.eq(test.t.find({loc:{$nearSphere:[-180, 0]}}, {_id:0}).limit(2).toArray(), [{loc: [-180, 0]}, {loc: [-179.999, 0]}]); |