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/noPassthroughWithMongod/apply_ops_errors.js | |
parent | 1e46b5049003f427047e723ea5fab15b5a9253ca (diff) | |
download | mongo-134a4083953270e8a11430395357fb70a29047ad.tar.gz |
SERVER-41772 Apply clang-format 7.0.1 to the codebase
Diffstat (limited to 'jstests/noPassthroughWithMongod/apply_ops_errors.js')
-rw-r--r-- | jstests/noPassthroughWithMongod/apply_ops_errors.js | 82 |
1 files changed, 41 insertions, 41 deletions
diff --git a/jstests/noPassthroughWithMongod/apply_ops_errors.js b/jstests/noPassthroughWithMongod/apply_ops_errors.js index 9441d006e43..0cf4a789718 100644 --- a/jstests/noPassthroughWithMongod/apply_ops_errors.js +++ b/jstests/noPassthroughWithMongod/apply_ops_errors.js @@ -13,45 +13,45 @@ */ (function() { - "use strict"; - var coll = db.apply_ops_errors; - coll.drop(); - - // Scenario 1: only one operation - assert.eq(0, coll.find().count(), "test collection not empty"); - coll.ensureIndex({x: 1}, {unique: true}); - coll.insert({_id: 1, x: "init"}); - - var res = db.runCommand({ - applyOps: [ - {op: "i", ns: coll.getFullName(), o: {_id: 2, x: "init"}}, - ] - }); - - assert.eq(1, res.applied); - assert(res.code); - assert(res.errmsg); - assert.eq([false], res.results); - assert.eq(0, res.ok); - - coll.drop(); - - // Scenario 2: Three operations, first two should run, second should fail. - assert.eq(0, coll.find().count(), "test collection not empty"); - coll.ensureIndex({x: 1}, {unique: true}); - coll.insert({_id: 1, x: "init"}); - - var res = db.runCommand({ - applyOps: [ - {op: "i", ns: coll.getFullName(), o: {_id: 3, x: "not init"}}, - {op: "i", ns: coll.getFullName(), o: {_id: 4, x: "init"}}, - {op: "i", ns: coll.getFullName(), o: {_id: 5, x: "not init again"}}, - ] - }); - - assert.eq(2, res.applied); - assert(res.code); - assert(res.errmsg); - assert.eq([false, false], res.results); - assert.eq(0, res.ok); +"use strict"; +var coll = db.apply_ops_errors; +coll.drop(); + +// Scenario 1: only one operation +assert.eq(0, coll.find().count(), "test collection not empty"); +coll.ensureIndex({x: 1}, {unique: true}); +coll.insert({_id: 1, x: "init"}); + +var res = db.runCommand({ + applyOps: [ + {op: "i", ns: coll.getFullName(), o: {_id: 2, x: "init"}}, + ] +}); + +assert.eq(1, res.applied); +assert(res.code); +assert(res.errmsg); +assert.eq([false], res.results); +assert.eq(0, res.ok); + +coll.drop(); + +// Scenario 2: Three operations, first two should run, second should fail. +assert.eq(0, coll.find().count(), "test collection not empty"); +coll.ensureIndex({x: 1}, {unique: true}); +coll.insert({_id: 1, x: "init"}); + +var res = db.runCommand({ + applyOps: [ + {op: "i", ns: coll.getFullName(), o: {_id: 3, x: "not init"}}, + {op: "i", ns: coll.getFullName(), o: {_id: 4, x: "init"}}, + {op: "i", ns: coll.getFullName(), o: {_id: 5, x: "not init again"}}, + ] +}); + +assert.eq(2, res.applied); +assert(res.code); +assert(res.errmsg); +assert.eq([false, false], res.results); +assert.eq(0, res.ok); })(); |