summaryrefslogtreecommitdiff
path: root/jstests/noPassthroughWithMongod/temp_namespace.js
diff options
context:
space:
mode:
Diffstat (limited to 'jstests/noPassthroughWithMongod/temp_namespace.js')
-rw-r--r--jstests/noPassthroughWithMongod/temp_namespace.js45
1 files changed, 24 insertions, 21 deletions
diff --git a/jstests/noPassthroughWithMongod/temp_namespace.js b/jstests/noPassthroughWithMongod/temp_namespace.js
index f74ac73bcea..a2f1aa21a80 100644
--- a/jstests/noPassthroughWithMongod/temp_namespace.js
+++ b/jstests/noPassthroughWithMongod/temp_namespace.js
@@ -7,31 +7,34 @@ testname = 'temp_namespace_sw';
var conn = MongoRunner.runMongod({smallfiles: "", noprealloc: "", nopreallocj: ""});
d = conn.getDB('test');
-d.runCommand({create: testname+'temp1', temp: true});
-d[testname+'temp1'].ensureIndex({x:1});
-d.runCommand({create: testname+'temp2', temp: 1});
-d[testname+'temp2'].ensureIndex({x:1});
-d.runCommand({create: testname+'keep1', temp: false});
-d.runCommand({create: testname+'keep2', temp: 0});
-d.runCommand({create: testname+'keep3'});
-d[testname+'keep4'].insert({});
+d.runCommand({create: testname + 'temp1', temp: true});
+d[testname + 'temp1'].ensureIndex({x: 1});
+d.runCommand({create: testname + 'temp2', temp: 1});
+d[testname + 'temp2'].ensureIndex({x: 1});
+d.runCommand({create: testname + 'keep1', temp: false});
+d.runCommand({create: testname + 'keep2', temp: 0});
+d.runCommand({create: testname + 'keep3'});
+d[testname + 'keep4'].insert({});
-function countCollectionNames( theDB, regex ) {
- return theDB.getCollectionNames().filter( function(z) {
- return z.match( regex ); } ).length;
+function countCollectionNames(theDB, regex) {
+ return theDB.getCollectionNames().filter(function(z) {
+ return z.match(regex);
+ }).length;
}
-assert.eq(countCollectionNames( d, /temp\d$/) , 2);
-assert.eq(countCollectionNames( d, /keep\d$/) , 4);
+assert.eq(countCollectionNames(d, /temp\d$/), 2);
+assert.eq(countCollectionNames(d, /keep\d$/), 4);
MongoRunner.stopMongod(conn);
-conn = MongoRunner.runMongod({restart:true,
- cleanData: false,
- dbpath: conn.dbpath,
- smallfiles: "",
- noprealloc: "",
- nopreallocj: ""});
+conn = MongoRunner.runMongod({
+ restart: true,
+ cleanData: false,
+ dbpath: conn.dbpath,
+ smallfiles: "",
+ noprealloc: "",
+ nopreallocj: ""
+});
d = conn.getDB('test');
-assert.eq(countCollectionNames( d, /temp\d$/) , 0);
-assert.eq(countCollectionNames( d, /keep\d$/) , 4);
+assert.eq(countCollectionNames(d, /temp\d$/), 0);
+assert.eq(countCollectionNames(d, /keep\d$/), 4);
MongoRunner.stopMongod(conn);