mirror of
https://github.com/mongodb/mongo.git
synced 2024-11-30 17:10:48 +01:00
debugging for test
This commit is contained in:
parent
3d5d5a29bd
commit
0a4d316701
@ -1,10 +1,19 @@
|
||||
db.f.drop();
|
||||
db.f.save( {} );
|
||||
db.f.save( {} );
|
||||
db.f.save( {} );
|
||||
t = db.f
|
||||
t.drop();
|
||||
t.save( {} );
|
||||
t.save( {} );
|
||||
t.save( {} );
|
||||
|
||||
db.getMongo().getDB( "admin" ).runCommand( {closeAllDatabases:1} );
|
||||
|
||||
assert.eq( 0, db.runCommand( {cursorInfo:1} ).clientCursors_size );
|
||||
assert.eq( 2, db.f.find( {} ).limit( 2 ).toArray().length );
|
||||
assert.eq( 1, db.runCommand( {cursorInfo:1} ).clientCursors_size );
|
||||
function test( want , msg ){
|
||||
var res = db.runCommand( { cursorInfo:1 } );
|
||||
assert.eq( want , res.clientCursors_size , msg + " " + tojson( res ) );
|
||||
}
|
||||
|
||||
test( 0 , "A1" );
|
||||
assert.eq( 2 , t.find().count() , "A1" );
|
||||
assert.eq( 2 , t.find( {} ).count() , "A2" );
|
||||
assert.eq( 2, t.find( {} ).limit( 2 ).itcount() , "A3" );
|
||||
test( 1 , "B1" );
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user