Skip to content

Commit 7466134

Browse files
committed
Added additional Map test
1 parent 8dd35ca commit 7466134

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

test/node/map_tests.js

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -104,3 +104,18 @@ exports['should serialize a map'] = function(test) {
104104
var data = bson.serialize(m, false, true);
105105
test.equal('13000000103100010000001030000200000000', data.toString('hex'));
106106
}
107+
108+
/**
109+
* @ignore
110+
*/
111+
exports['should not crash due to object that looks like map'] = function(test) {
112+
// Serialize top level map only
113+
var m = { entries: "test" };
114+
var bson = createBSON();
115+
// Serialize the map
116+
var data = bson.serialize(m, false, true);
117+
// Deserialize the data
118+
var object = bson.deserialize(data);
119+
test.deepEqual(m, object);
120+
test.done();
121+
}

0 commit comments

Comments
 (0)