summaryrefslogtreecommitdiff
path: root/jstests/noPassthroughWithMongod/validate_command.js
diff options
context:
space:
mode:
Diffstat (limited to 'jstests/noPassthroughWithMongod/validate_command.js')
-rw-r--r--jstests/noPassthroughWithMongod/validate_command.js52
1 files changed, 26 insertions, 26 deletions
diff --git a/jstests/noPassthroughWithMongod/validate_command.js b/jstests/noPassthroughWithMongod/validate_command.js
index 9c52c9acad7..7f5a8533705 100644
--- a/jstests/noPassthroughWithMongod/validate_command.js
+++ b/jstests/noPassthroughWithMongod/validate_command.js
@@ -1,40 +1,40 @@
// Tests that the basic values returned from the validate command are correct
(function() {
- // Set the number of documents to insert
- var count = 10;
+// Set the number of documents to insert
+var count = 10;
- function testValidate(output) {
- assert.eq(output.nrecords, count, "validate returned an invalid count");
- assert.eq(output.nIndexes, 3, "validate returned an invalid number of indexes");
+function testValidate(output) {
+ assert.eq(output.nrecords, count, "validate returned an invalid count");
+ assert.eq(output.nIndexes, 3, "validate returned an invalid number of indexes");
- var indexNames = output.keysPerIndex;
+ var indexNames = output.keysPerIndex;
- for (var i in indexNames) {
- if (!indexNames.hasOwnProperty(i))
- continue;
- assert.eq(indexNames[i], count, "validate returned an invalid number of indexes");
- }
+ for (var i in indexNames) {
+ if (!indexNames.hasOwnProperty(i))
+ continue;
+ assert.eq(indexNames[i], count, "validate returned an invalid number of indexes");
}
+}
- // Test to confirm that validate is working as expected.
+// Test to confirm that validate is working as expected.
- // SETUP DATA
- t = db.jstests_validate;
- t.drop();
+// SETUP DATA
+t = db.jstests_validate;
+t.drop();
- for (var i = 0; i < count; i++) {
- t.insert({x: i});
- }
+for (var i = 0; i < count; i++) {
+ t.insert({x: i});
+}
- t.ensureIndex({x: 1}, {name: "forward"});
- t.ensureIndex({x: -1}, {name: "reverse"});
+t.ensureIndex({x: 1}, {name: "forward"});
+t.ensureIndex({x: -1}, {name: "reverse"});
- // TEST NORMAL VALIDATE
- var output = t.validate();
- testValidate(output);
+// TEST NORMAL VALIDATE
+var output = t.validate();
+testValidate(output);
- // TEST FULL
- var output = t.validate({full: true});
- testValidate(output);
+// TEST FULL
+var output = t.validate({full: true});
+testValidate(output);
}()); \ No newline at end of file