diff options
author | Antonin Kral <a.kral@bobek.cz> | 2010-03-25 19:21:32 +0100 |
---|---|---|
committer | Antonin Kral <a.kral@bobek.cz> | 2010-03-25 19:21:32 +0100 |
commit | 0ca01a91ae0a3562e54c226e7b9512feb2ea83d0 (patch) | |
tree | 2b3886e435b0217d6afd63a213b04d32bb4b4f6f /jstests/capped3.js | |
parent | a696359b248adef0cc8576fce3f473535e995136 (diff) | |
download | mongodb-0ca01a91ae0a3562e54c226e7b9512feb2ea83d0.tar.gz |
Imported Upstream version 1.4.0
Diffstat (limited to 'jstests/capped3.js')
-rw-r--r-- | jstests/capped3.js | 22 |
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" ); |