summaryrefslogtreecommitdiff
path: root/jstests
diff options
context:
space:
mode:
authorAaron <aaron@10gen.com>2009-05-20 17:04:38 -0400
committerAaron <aaron@10gen.com>2009-05-20 17:04:38 -0400
commiteb8b92ab103508a7083f9757ec6f20baf6ad4df1 (patch)
tree93e7a320a7e1a737df192d03266e6e8dd8f5e2f4 /jstests
parent5fb086799747738cd0afb7239cbdcdaf66ae4664 (diff)
parentf1ff2f1a57f466983b138024264b31ce6748be74 (diff)
downloadmongo-eb8b92ab103508a7083f9757ec6f20baf6ad4df1.tar.gz
Merge branch 'master' of git@github.com:mongodb/mongo
Diffstat (limited to 'jstests')
-rw-r--r--jstests/capped3.js3
-rw-r--r--jstests/eval7.js3
-rw-r--r--jstests/repl/repl8.js17
3 files changed, 21 insertions, 2 deletions
diff --git a/jstests/capped3.js b/jstests/capped3.js
index 4b9938c12eb..f3b29b7503d 100644
--- a/jstests/capped3.js
+++ b/jstests/capped3.js
@@ -32,8 +32,7 @@ t2.drop();
for( i = 0; i < 1000; ++i ) {
t.save( {i:i} );
}
-//assert.commandWorked( db.runCommand( { convertToCapped:"jstests_capped3", size:1000 } ) );
-assert( t.convertToCapped( 1000 ).ok )
+assert.commandWorked( t.convertToCapped( 1000 ) );
c = t.find().sort( {$natural:-1} );
i = 999;
while( c.hasNext() ) {
diff --git a/jstests/eval7.js b/jstests/eval7.js
new file mode 100644
index 00000000000..45e06af276c
--- /dev/null
+++ b/jstests/eval7.js
@@ -0,0 +1,3 @@
+
+assert.eq( 6 , db.eval( "5 + 1" ) , "A" )
+assert.throws( function(z){ db.eval( "5 + function x; + 1" )} );
diff --git a/jstests/repl/repl8.js b/jstests/repl/repl8.js
new file mode 100644
index 00000000000..e7d1f12f54a
--- /dev/null
+++ b/jstests/repl/repl8.js
@@ -0,0 +1,17 @@
+// Test cloning of capped collections
+
+baseName = "jstests_repl_repl8";
+
+ports = allocatePorts( 2 );
+
+m = startMongod( "--port", ports[ 0 ], "--dbpath", "/data/db/" + baseName + "-master", "--master", "--oplogSize", "1", "--nohttpinterface", "--bind_ip", "127.0.0.1" );
+
+m.getDB( baseName ).createCollection( "first", {capped:true,size:1000} );
+assert( m.getDB( baseName ).getCollection( "first" ).isCapped() );
+
+s = startMongod( "--port", ports[ 1 ], "--dbpath", "/data/db/" + baseName + "-slave", "--slave", "--source", "127.0.0.1:" + ports[ 0 ], "--nohttpinterface", "--bind_ip", "127.0.0.1" );
+
+assert.soon( function() { return s.getDB( baseName ).getCollection( "first" ).isCapped(); } );
+
+m.getDB( baseName ).createCollection( "second", {capped:true,size:1000} );
+assert.soon( function() { return s.getDB( baseName ).getCollection( "second" ).isCapped(); } );