diff options
author | clang-format-7.0.1 <adam.martin@10gen.com> | 2019-07-26 18:20:35 -0400 |
---|---|---|
committer | ADAM David Alan Martin <adam.martin@10gen.com> | 2019-07-27 11:02:23 -0400 |
commit | 134a4083953270e8a11430395357fb70a29047ad (patch) | |
tree | dd428e1230e31d92b20b393dfdc17ffe7fa79cb6 /jstests/noPassthrough/compression_options.js | |
parent | 1e46b5049003f427047e723ea5fab15b5a9253ca (diff) | |
download | mongo-134a4083953270e8a11430395357fb70a29047ad.tar.gz |
SERVER-41772 Apply clang-format 7.0.1 to the codebase
Diffstat (limited to 'jstests/noPassthrough/compression_options.js')
-rw-r--r-- | jstests/noPassthrough/compression_options.js | 77 |
1 files changed, 38 insertions, 39 deletions
diff --git a/jstests/noPassthrough/compression_options.js b/jstests/noPassthrough/compression_options.js index c6f4ccadc68..db4b9b4d050 100644 --- a/jstests/noPassthrough/compression_options.js +++ b/jstests/noPassthrough/compression_options.js @@ -1,43 +1,42 @@ // Tests --networkMessageCompressors options. (function() { - 'use strict'; - - var runTest = function(optionValue, expected) { - jsTest.log("Testing with --networkMessageCompressors=\"" + optionValue + "\" expecting: " + - expected); - var mongo = MongoRunner.runMongod({networkMessageCompressors: optionValue}); - assert.commandWorked(mongo.adminCommand({isMaster: 1})); - clearRawMongoProgramOutput(); - assert.eq(runMongoProgram("mongo", - "--eval", - "tostrictjson(db.isMaster());", - "--port", - mongo.port, - "--networkMessageCompressors=snappy"), - 0); - - var output = rawMongoProgramOutput() - .split("\n") - .map(function(str) { - str = str.replace(/^sh[0-9]+\| /, ""); - if (!/^{/.test(str)) { - return ""; - } - return str; - }) - .join("\n") - .trim(); - - output = JSON.parse(output); - - assert.eq(output.compression, expected); - MongoRunner.stopMongod(mongo); - }; - - assert.isnull(MongoRunner.runMongod({networkMessageCompressors: "snappy,disabled"})); - - runTest("snappy", ["snappy"]); - runTest("disabled", undefined); - +'use strict'; + +var runTest = function(optionValue, expected) { + jsTest.log("Testing with --networkMessageCompressors=\"" + optionValue + + "\" expecting: " + expected); + var mongo = MongoRunner.runMongod({networkMessageCompressors: optionValue}); + assert.commandWorked(mongo.adminCommand({isMaster: 1})); + clearRawMongoProgramOutput(); + assert.eq(runMongoProgram("mongo", + "--eval", + "tostrictjson(db.isMaster());", + "--port", + mongo.port, + "--networkMessageCompressors=snappy"), + 0); + + var output = rawMongoProgramOutput() + .split("\n") + .map(function(str) { + str = str.replace(/^sh[0-9]+\| /, ""); + if (!/^{/.test(str)) { + return ""; + } + return str; + }) + .join("\n") + .trim(); + + output = JSON.parse(output); + + assert.eq(output.compression, expected); + MongoRunner.stopMongod(mongo); +}; + +assert.isnull(MongoRunner.runMongod({networkMessageCompressors: "snappy,disabled"})); + +runTest("snappy", ["snappy"]); +runTest("disabled", undefined); }()); |