Files: ca90b5ca0579ebdcc0635288bce4978e3fb200f5 / test / test-79-npm / bson / bson@0.2.22.js
661 bytesRaw
1 | ; |
2 | |
3 | var bson = require('bson'); |
4 | |
5 | var pure = {}; |
6 | pure.Long = bson.pure().Long; |
7 | pure.doc = { long: pure.Long.fromNumber(100) }; |
8 | pure.BSON = bson.pure().BSON; |
9 | pure.obj = new (pure.BSON)(); |
10 | pure.data = pure.obj.serialize(pure.doc, false, true, false); |
11 | pure.doc2 = pure.obj.deserialize(pure.data); |
12 | |
13 | var natv = {}; |
14 | natv.Long = bson.native().Long; |
15 | natv.doc = { long: natv.Long.fromNumber(200) }; |
16 | natv.BSON = bson.native().BSON; |
17 | natv.obj = new (natv.BSON)(); |
18 | natv.data = natv.obj.serialize(natv.doc, false, true, false); |
19 | natv.doc2 = natv.obj.deserialize(natv.data); |
20 | |
21 | if (pure.doc2.long === 100) { |
22 | if (natv.doc2.long === 200) { |
23 | console.log('ok'); |
24 | } |
25 | } |
26 |
Built with git-ssb-web