summaryrefslogtreecommitdiff
path: root/jstests/capped3.js
diff options
context:
space:
mode:
authorAntonin Kral <a.kral@bobek.cz>2010-03-25 19:21:32 +0100
committerAntonin Kral <a.kral@bobek.cz>2010-03-25 19:21:32 +0100
commit0ca01a91ae0a3562e54c226e7b9512feb2ea83d0 (patch)
tree2b3886e435b0217d6afd63a213b04d32bb4b4f6f /jstests/capped3.js
parenta696359b248adef0cc8576fce3f473535e995136 (diff)
downloadmongodb-0ca01a91ae0a3562e54c226e7b9512feb2ea83d0.tar.gz
Imported Upstream version 1.4.0
Diffstat (limited to 'jstests/capped3.js')
-rw-r--r--jstests/capped3.js22
1 files changed, 12 insertions, 10 deletions
diff --git a/jstests/capped3.js b/jstests/capped3.js
index f3b29b7..c4f1a3c 100644
--- a/jstests/capped3.js
+++ b/jstests/capped3.js
@@ -5,12 +5,12 @@ t2.drop();
for( i = 0; i < 1000; ++i ) {
t.save( {i:i} );
}
-assert.commandWorked( db.runCommand( { cloneCollectionAsCapped:"jstests_capped3", toCollection:"jstests_capped3_clone", size:100000 } ) );
+assert.commandWorked( db.runCommand( { cloneCollectionAsCapped:"jstests_capped3", toCollection:"jstests_capped3_clone", size:100000 } ), "A" );
c = t2.find();
for( i = 0; i < 1000; ++i ) {
- assert.eq( i, c.next().i );
+ assert.eq( i, c.next().i, "B" );
}
-assert( !c.hasNext() );
+assert( !c.hasNext(), "C" );
t.drop();
t2.drop();
@@ -18,13 +18,15 @@ t2.drop();
for( i = 0; i < 1000; ++i ) {
t.save( {i:i} );
}
-assert.commandWorked( db.runCommand( { cloneCollectionAsCapped:"jstests_capped3", toCollection:"jstests_capped3_clone", size:1000 } ) );
+assert.commandWorked( db.runCommand( { cloneCollectionAsCapped:"jstests_capped3", toCollection:"jstests_capped3_clone", size:1000 } ), "D" );
c = t2.find().sort( {$natural:-1} );
i = 999;
while( c.hasNext() ) {
- assert.eq( i--, c.next().i );
+ assert.eq( i--, c.next().i, "E" );
}
-assert( i < 990 );
+print( "i: " + i );
+print( "stats: " + tojson( t2.stats() ) );
+assert( i < 990, "F" );
t.drop();
t2.drop();
@@ -32,11 +34,11 @@ t2.drop();
for( i = 0; i < 1000; ++i ) {
t.save( {i:i} );
}
-assert.commandWorked( t.convertToCapped( 1000 ) );
+assert.commandWorked( t.convertToCapped( 1000 ), "G" );
c = t.find().sort( {$natural:-1} );
i = 999;
while( c.hasNext() ) {
- assert.eq( i--, c.next().i );
+ assert.eq( i--, c.next().i, "H" );
}
-assert( i < 990 );
-assert( i > 900 );
+assert( i < 990, "I" );
+assert( i > 900, "J" );