diff options
Diffstat (limited to 'jstests/core/regex6.js')
-rw-r--r-- | jstests/core/regex6.js | 48 |
1 files changed, 20 insertions, 28 deletions
diff --git a/jstests/core/regex6.js b/jstests/core/regex6.js index 7b9ed1910ed..b7e90664c4d 100644 --- a/jstests/core/regex6.js +++ b/jstests/core/regex6.js @@ -11,30 +11,24 @@ t.save({name: "[with]some?symbols"}); t.ensureIndex({name: 1}); assert.eq(0, t.find({name: /^\//}).count(), "index count"); -assert.eq(1, - t.find({name: /^\//}).explain(true).executionStats.totalKeysExamined, - "index explain 1"); -assert.eq(0, - t.find({name: /^é/}).explain(true).executionStats.totalKeysExamined, - "index explain 2"); -assert.eq(0, - t.find({name: /^\é/}).explain(true).executionStats.totalKeysExamined, - "index explain 3"); -assert.eq(1, - t.find({name: /^\./}).explain(true).executionStats.totalKeysExamined, - "index explain 4"); -assert.eq(5, - t.find({name: /^./}).explain(true).executionStats.totalKeysExamined, - "index explain 5"); +assert.eq( + 1, t.find({name: /^\//}).explain(true).executionStats.totalKeysExamined, "index explain 1"); +assert.eq( + 0, t.find({name: /^é/}).explain(true).executionStats.totalKeysExamined, "index explain 2"); +assert.eq( + 0, t.find({name: /^\é/}).explain(true).executionStats.totalKeysExamined, "index explain 3"); +assert.eq( + 1, t.find({name: /^\./}).explain(true).executionStats.totalKeysExamined, "index explain 4"); +assert.eq( + 5, t.find({name: /^./}).explain(true).executionStats.totalKeysExamined, "index explain 5"); // SERVER-2862 assert.eq(0, t.find({name: /^\Qblah\E/}).count(), "index explain 6"); assert.eq(1, t.find({name: /^\Qblah\E/}).explain(true).executionStats.totalKeysExamined, "index explain 6"); -assert.eq(1, - t.find({name: /^blah/}).explain(true).executionStats.totalKeysExamined, - "index explain 6"); +assert.eq( + 1, t.find({name: /^blah/}).explain(true).executionStats.totalKeysExamined, "index explain 6"); assert.eq(1, t.find({name: /^\Q[\Ewi\Qth]some?s\Eym/}).count(), "index count 2"); assert.eq(2, t.find({name: /^\Q[\Ewi\Qth]some?s\Eym/}).explain(true).executionStats.totalKeysExamined, @@ -43,13 +37,11 @@ assert.eq(2, t.find({name: /^bob/}).explain(true).executionStats.totalKeysExamined, "index explain 6"); // proof executionStats.totalKeysExamined == count+1 -assert.eq(1, - t.find({name: {$regex: "^e", $gte: "emily"}}) - .explain(true) - .executionStats.totalKeysExamined, - "ie7"); -assert.eq(1, - t.find({name: {$gt: "a", $regex: "^emily"}}) - .explain(true) - .executionStats.totalKeysExamined, - "ie7"); +assert.eq( + 1, + t.find({name: {$regex: "^e", $gte: "emily"}}).explain(true).executionStats.totalKeysExamined, + "ie7"); +assert.eq( + 1, + t.find({name: {$gt: "a", $regex: "^emily"}}).explain(true).executionStats.totalKeysExamined, + "ie7"); |