Files
mongo/jstests/core/string_with_nul_bytes.js
Siyuan Zhou 3660343e0b SERVER-12127 migrate js tests to jscore suite when not related to writes
Migrate js tests starting from j-z.
Include SERVER-12920 Update use_power_of_2.js

Signed-off-by: Matt Kangas <matt.kangas@mongodb.com>
2014-03-03 22:54:10 -05:00

10 lines
285 B
JavaScript

// SERVER-6649 - issues round-tripping strings with embedded NUL bytes
t = db.string_with_nul_bytes.js;
t.drop();
string = "string with a NUL (\0) byte";
t.insert({str:string});
assert.eq(t.findOne().str, string);
assert.eq(t.findOne().str.length, string.length); // just to be sure