Permalink
Browse files

SERVER-5274: updatek.js failing in V8

  • Loading branch information...
1 parent 206a2db commit 825c8b7fa8cb3e907f651692b4e8410e524d7720 @agirbal agirbal committed Mar 13, 2012
Showing with 5 additions and 2 deletions.
  1. +5 −2 jstests/updatek.js
View
@@ -5,9 +5,12 @@ t = db.jstests_updatek;
t.drop();
t.save( { _id:0, '1':{}, '01':{} } );
t.update( {}, { $set:{ '1.b':1, '1.c':2 } } );
-assert.eq( { '01':{}, '1':{ b:1, c:2 }, _id:0 }, t.findOne() );
+// make sure correct fields are set, with no duplicates
+// must use string comparison because V8 reorders fields that are numerical in objects
+assert.eq( "{ \"01\" : { }, \"1\" : { \"b\" : 1, \"c\" : 2 }, \"_id\" : 0 }", tojson(t.findOne()) );
t.drop();
t.save( { _id:0, '1':{}, '01':{} } );
t.update( {}, { $set:{ '1.b':1, '01.c':2 } } );
-assert.eq( { '01':{ c:2 }, '1':{ b:1 }, _id:0 }, t.findOne() );
+assert.eq( "{ \"01\" : { \"c\" : 2 }, \"1\" : { \"b\" : 1 }, \"_id\" : 0 }", tojson(t.findOne()) );
+

0 comments on commit 825c8b7

Please sign in to comment.