summaryrefslogtreecommitdiff
path: root/src/mongo/shell/assert.js
diff options
context:
space:
mode:
authorclang-format-7.0.1 <adam.martin@10gen.com>2019-07-26 18:20:35 -0400
committerADAM David Alan Martin <adam.martin@10gen.com>2019-07-27 11:02:23 -0400
commit134a4083953270e8a11430395357fb70a29047ad (patch)
treedd428e1230e31d92b20b393dfdc17ffe7fa79cb6 /src/mongo/shell/assert.js
parent1e46b5049003f427047e723ea5fab15b5a9253ca (diff)
downloadmongo-134a4083953270e8a11430395357fb70a29047ad.tar.gz
SERVER-41772 Apply clang-format 7.0.1 to the codebase
Diffstat (limited to 'src/mongo/shell/assert.js')
-rw-r--r--src/mongo/shell/assert.js22
1 files changed, 10 insertions, 12 deletions
diff --git a/src/mongo/shell/assert.js b/src/mongo/shell/assert.js
index ce2ec257763..20c8f2d481b 100644
--- a/src/mongo/shell/assert.js
+++ b/src/mongo/shell/assert.js
@@ -1,13 +1,13 @@
doassert = function(msg, obj) {
// eval if msg is a function
- if (typeof(msg) == "function")
+ if (typeof (msg) == "function")
msg = msg();
- if (typeof(msg) == "object")
+ if (typeof (msg) == "object")
msg = tojson(msg);
if (jsTest.options().traceExceptions) {
- if (typeof(msg) == "string" && msg.indexOf("assert") == 0)
+ if (typeof (msg) == "string" && msg.indexOf("assert") == 0)
print(msg);
else
print("assert: " + msg);
@@ -27,7 +27,6 @@ doassert = function(msg, obj) {
// Sort doc/obj fields and return new sorted obj
sortDoc = function(doc) {
-
// Helper to sort the elements of the array
var sortElementsOfArray = function(arr) {
var newArr = [];
@@ -318,7 +317,7 @@ assert = (function() {
var msgPrefix = "assert.soon failed: " + func;
if (msg) {
- if (typeof(msg) != "function") {
+ if (typeof (msg) != "function") {
msgPrefix = "assert.soon failed, msg";
}
}
@@ -328,7 +327,7 @@ assert = (function() {
interval = interval || 200;
var last;
while (1) {
- if (typeof(func) == "string") {
+ if (typeof (func) == "string") {
if (eval(func))
return;
} else {
@@ -418,7 +417,7 @@ assert = (function() {
var start = new Date();
timeout = timeout || 30000;
- if (typeof(f) == "string") {
+ if (typeof (f) == "string") {
res = eval(f);
} else {
res = f();
@@ -929,7 +928,6 @@ assert = (function() {
};
assert.gleOK = function(res, msg) {
-
var errMsg = null;
if (!res) {
@@ -950,7 +948,7 @@ assert = (function() {
assert.gleSuccess = function(dbOrGLEDoc, msg) {
var gle = dbOrGLEDoc instanceof DB ? dbOrGLEDoc.getLastErrorObj() : dbOrGLEDoc;
if (gle.err) {
- if (typeof(msg) == "function")
+ if (typeof (msg) == "function")
msg = msg(gle);
doassert(_buildAssertionMessage(msg, "getLastError not null: " + tojson(gle)), gle);
}
@@ -960,7 +958,7 @@ assert = (function() {
assert.gleError = function(dbOrGLEDoc, msg) {
var gle = dbOrGLEDoc instanceof DB ? dbOrGLEDoc.getLastErrorObj() : dbOrGLEDoc;
if (!gle.err) {
- if (typeof(msg) == "function")
+ if (typeof (msg) == "function")
msg = msg(gle);
doassert(_buildAssertionMessage(msg, "getLastError is null: " + tojson(gle)));
}
@@ -969,7 +967,7 @@ assert = (function() {
assert.gleErrorCode = function(dbOrGLEDoc, code, msg) {
var gle = dbOrGLEDoc instanceof DB ? dbOrGLEDoc.getLastErrorObj() : dbOrGLEDoc;
if (!gle.err || gle.code != code) {
- if (typeof(msg) == "function")
+ if (typeof (msg) == "function")
msg = msg(gle);
doassert(_buildAssertionMessage(
msg,
@@ -980,7 +978,7 @@ assert = (function() {
assert.gleErrorRegex = function(dbOrGLEDoc, regex, msg) {
var gle = dbOrGLEDoc instanceof DB ? dbOrGLEDoc.getLastErrorObj() : dbOrGLEDoc;
if (!gle.err || !regex.test(gle.err)) {
- if (typeof(msg) == "function")
+ if (typeof (msg) == "function")
msg = msg(gle);
doassert(_buildAssertionMessage(
msg,