Files
mongo/jstests/core/null_field_name.js
Robert Guo 5b93d767f4 SERVER-21089 fix assert.throw/doesNotThrow() argument validation
SERVER-21087 prevent use of "this" in the function passed to assert.throw/doesNotThrow()
2016-10-27 11:33:40 -04:00

8 lines
284 B
JavaScript

// SERVER-10313: Test that null char in field name causes an error when converting to bson
assert.throws(function() {
Object.bsonsize({"a\0": 1});
}, [], "null char in field name");
assert.throws(function() {
Object.bsonsize({"\0asdf": 1});
}, [], "null char in field name");