0
0
mirror of https://github.com/mongodb/mongo.git synced 2024-12-01 09:32:32 +01:00
mongodb/jstests/date1.js
2011-06-06 19:53:49 -04:00

18 lines
317 B
JavaScript

t = db.date1;
function go( d , msg ){
t.drop();
t.save({ a: 1, d: d });
// printjson(d);
// printjson(t.findOne().d);
assert.eq( d , t.findOne().d , msg )
}
go( new Date() , "A" )
go( new Date( 1 ) , "B")
go( new Date( 0 ) , "C (old spidermonkey lib fails this test)")
go(new Date(-10), "neg")