Skip to content

Commit

Permalink
better asserts
Browse files Browse the repository at this point in the history
  • Loading branch information
erh committed May 14, 2009
1 parent c6eaf9c commit a1da020
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions jstests/update3.js
Expand Up @@ -5,19 +5,19 @@ f = db.jstests_update3;
f.drop(); f.drop();
f.save( { a:1 } ); f.save( { a:1 } );
f.update( {}, {$inc:{ a:1 }} ); f.update( {}, {$inc:{ a:1 }} );
assert.eq( 2, f.findOne().a ); assert.eq( 2, f.findOne().a , "A" );


f.drop(); f.drop();
f.save( { a:{ b: 1 } } ); f.save( { a:{ b: 1 } } );
f.update( {}, {$inc:{ "a.b":1 }} ); f.update( {}, {$inc:{ "a.b":1 }} );
assert.eq( 2, f.findOne().a.b ); assert.eq( 2, f.findOne().a.b , "B" );


f.drop(); f.drop();
f.save( { a:{ b: 1 } } ); f.save( { a:{ b: 1 } } );
f.update( {}, {$set:{ "a.b":5 }} ); f.update( {}, {$set:{ "a.b":5 }} );
assert.eq( 5, f.findOne().a.b ); assert.eq( 5, f.findOne().a.b , "C" );


f.drop(); f.drop();
f.save( {'_id':0} ); f.save( {'_id':0} );
f.update( {}, {$set:{'_id':5}} ); f.update( {}, {$set:{'_id':5}} );
assert.eq( 0, f.findOne()._id ); assert.eq( 0, f.findOne()._id , "D" );

0 comments on commit a1da020

Please sign in to comment.