diff options
Diffstat (limited to 'jstests')
-rw-r--r-- | jstests/db.js | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/jstests/db.js b/jstests/db.js new file mode 100644 index 00000000000..5ed978874c3 --- /dev/null +++ b/jstests/db.js @@ -0,0 +1,11 @@ +function testInvalidDBNameThrowsExceptionWithConstructor() { + assert.throws( function() { return new DB( null, "*?" ); } ); +} + +function testInvalidDBNameThrowsExceptionWithSibling() { + assert.throws( function() { return db.getSiblingDB( "/\\" ); } ); +} + +testInvalidDBNameThrowsExceptionWithConstructor(); +testInvalidDBNameThrowsExceptionWithSibling(); + |