diff options
Diffstat (limited to 'jstests/core/list_indexes_invalid.js')
-rw-r--r-- | jstests/core/list_indexes_invalid.js | 68 |
1 files changed, 36 insertions, 32 deletions
diff --git a/jstests/core/list_indexes_invalid.js b/jstests/core/list_indexes_invalid.js index 0e9c5ffa88c..43d64a594c2 100644 --- a/jstests/core/list_indexes_invalid.js +++ b/jstests/core/list_indexes_invalid.js @@ -1,32 +1,36 @@ -// Test for invalid values of "cursor" and "cursor.batchSize".
-
-var coll = db.list_indexes_invalid;
-coll.drop();
-
-assert.commandWorked(coll.getDB().createCollection(coll.getName()));
-assert.commandWorked(coll.ensureIndex({a: 1}, {unique: true}));
-
-assert.throws(function() {
- getListIndexesCursor(coll, {cursor: 0});
-});
-assert.throws(function() {
- getListIndexesCursor(coll, {cursor: 'x'});
-});
-assert.throws(function() {
- getListIndexesCursor(coll, {cursor: []});
-});
-assert.throws(function() {
- getListIndexesCursor(coll, {cursor: {foo: 1}});
-});
-assert.throws(function() {
- getListIndexesCursor(coll, {cursor: {batchSize: -1}});
-});
-assert.throws(function() {
- getListIndexesCursor(coll, {cursor: {batchSize: 'x'}});
-});
-assert.throws(function() {
- getListIndexesCursor(coll, {cursor: {batchSize: {}}});
-});
-assert.throws(function() {
- getListIndexesCursor(coll, {cursor: {batchSize: 2, foo: 1}});
-});
+// Cannot implicitly shard accessed collections because of collection existing when none +// expected. +// @tags: [assumes_no_implicit_collection_creation_after_drop] + +// Test for invalid values of "cursor" and "cursor.batchSize". + +var coll = db.list_indexes_invalid; +coll.drop(); + +assert.commandWorked(coll.getDB().createCollection(coll.getName())); +assert.commandWorked(coll.ensureIndex({a: 1}, {unique: true})); + +assert.throws(function() { + getListIndexesCursor(coll, {cursor: 0}); +}); +assert.throws(function() { + getListIndexesCursor(coll, {cursor: 'x'}); +}); +assert.throws(function() { + getListIndexesCursor(coll, {cursor: []}); +}); +assert.throws(function() { + getListIndexesCursor(coll, {cursor: {foo: 1}}); +}); +assert.throws(function() { + getListIndexesCursor(coll, {cursor: {batchSize: -1}}); +}); +assert.throws(function() { + getListIndexesCursor(coll, {cursor: {batchSize: 'x'}}); +}); +assert.throws(function() { + getListIndexesCursor(coll, {cursor: {batchSize: {}}}); +}); +assert.throws(function() { + getListIndexesCursor(coll, {cursor: {batchSize: 2, foo: 1}}); +}); |