summaryrefslogtreecommitdiff
path: root/jstests/core/db.js
diff options
context:
space:
mode:
Diffstat (limited to 'jstests/core/db.js')
-rw-r--r--jstests/core/db.js11
1 files changed, 11 insertions, 0 deletions
diff --git a/jstests/core/db.js b/jstests/core/db.js
new file mode 100644
index 00000000000..66a0bd73ede
--- /dev/null
+++ b/jstests/core/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();
+