summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorsebastianro <sebastianro@apache.org>2016-04-15 18:37:35 +0200
committersebastianro <sebastianro@apache.org>2016-04-23 19:22:36 +0200
commit6c4f3d9a841cc0f10c2235eb807461eda9497a6d (patch)
tree522e0d6ee026206ee82b5d7f89c0a841112f2f29
parent0eac44c9d1dd92803a77bbb34a879b0e6b9b5982 (diff)
downloadcouchdb-6c4f3d9a841cc0f10c2235eb807461eda9497a6d.tar.gz
Bring multi key design test back
-rw-r--r--test/javascript/tests/view_multi_key_design.js60
1 files changed, 35 insertions, 25 deletions
diff --git a/test/javascript/tests/view_multi_key_design.js b/test/javascript/tests/view_multi_key_design.js
index 12be7b5be..a50d1fb9f 100644
--- a/test/javascript/tests/view_multi_key_design.js
+++ b/test/javascript/tests/view_multi_key_design.js
@@ -11,7 +11,6 @@
// the License.
couchTests.view_multi_key_design = function(debug) {
- return console.log('TODO');
var db_name = get_random_db_name();
var db = new CouchDB(db_name, {"X-Couch-Full-Commit":"false"});
db.createDb();
@@ -155,69 +154,80 @@ couchTests.view_multi_key_design = function(debug) {
// Check offset works
curr = db.view("test/multi_emit", {skip: 1}, [0]).rows;
T(curr.length == 99);
- T(curr[0].value == 1);
+ // values are arbitrary as too many keys are the same
+ //T(curr[0].value == 1);
curr = db.view("test/multi_emit", {skip: 1, keys: [0]}, null).rows;
T(curr.length == 99);
- T(curr[0].value == 1);
+ // values are arbitrary as too many keys are the same
+ //T(curr[0].value == 1);
// Check that dir works
curr = db.view("test/multi_emit", {descending: "true"}, [1]).rows;
T(curr.length == 100);
- T(curr[0].value == 99);
- T(curr[99].value == 0);
+ // values are arbitrary as too many keys are the same
+ //T(curr[0].value == 99);
+ //T(curr[99].value == 0);
curr = db.view("test/multi_emit", {descending: "true", keys: [1]}, null).rows;
T(curr.length == 100);
- T(curr[0].value == 99);
- T(curr[99].value == 0);
+ // values are arbitrary as too many keys are the same
+ //T(curr[0].value == 99);
+ //T(curr[99].value == 0);
// Check a couple combinations
curr = db.view("test/multi_emit", {descending: "true", skip: 3, limit: 2}, [2]).rows;
T(curr.length, 2);
- T(curr[0].value == 96);
- T(curr[1].value == 95);
+ // values are arbitrary as too many keys are the same
+ //T(curr[0].value == 96);
+ //T(curr[1].value == 95);
curr = db.view("test/multi_emit", {descending: "true", skip: 3, limit: 2, keys: [2]}, null).rows;
T(curr.length, 2);
- T(curr[0].value == 96);
- T(curr[1].value == 95);
+ // values are arbitrary as too many keys are the same
+ //T(curr[0].value == 96);
+ //T(curr[1].value == 95);
+ curr = db.view("test/multi_emit", {skip: 0, limit: 1, startkey_docid: "13"}, [0]).rows;
+ // that's the maximum we can get
+ T(curr.length == 1);
+ T(curr[0].value == 13);
+
curr = db.view("test/multi_emit", {skip: 2, limit: 3, startkey_docid: "13"}, [0]).rows;
T(curr.length == 3);
- T(curr[0].value == 15);
- T(curr[1].value == 16);
- T(curr[2].value == 17);
+ // values are arbitrary as too many keys are the same
+ //T(curr[0].value == 15);
+ //T(curr[1].value == 16);
+ //T(curr[2].value == 17);
curr = db.view("test/multi_emit", {skip: 2, limit: 3, startkey_docid: "13", keys: [0]}, null).rows;
T(curr.length == 3);
- T(curr[0].value == 15);
- T(curr[1].value == 16);
- T(curr[2].value == 17);
+ // values are arbitrary as too many keys are the same
+ //T(curr[0].value == 15);
+ //T(curr[1].value == 16);
+ //T(curr[2].value == 17);
curr = db.view("test/multi_emit",
{skip: 1, limit: 5, startkey_docid: "25", endkey_docid: "27"}, [1]).rows;
T(curr.length == 2);
- T(curr[0].value == 26);
- T(curr[1].value == 27);
+ // that's again the maximum we can get
+ T(curr[0].value == 26 || curr[0].value == 27);
curr = db.view("test/multi_emit",
{skip: 1, limit: 5, startkey_docid: "25", endkey_docid: "27", keys: [1]}, null).rows;
T(curr.length == 2);
- T(curr[0].value == 26);
- T(curr[1].value == 27);
+ // that's again the maximum we can get
+ T(curr[0].value == 26 || curr[0].value == 27);
curr = db.view("test/multi_emit",
{skip: 1, limit: 5, startkey_docid: "28", endkey_docid: "26", descending: "true"}, [1]).rows;
T(curr.length == 2);
- T(curr[0].value == 27);
- T(curr[1].value == 26);
+ // that's again the maximum we can get
+ T(curr[0].value == 26 || curr[0].value == 27);
curr = db.view("test/multi_emit",
{skip: 1, limit: 5, startkey_docid: "28", endkey_docid: "26", descending: "true", keys: [1]}, null).rows;
T(curr.length == 2);
- T(curr[0].value == 27);
- T(curr[1].value == 26);
// cleanup
db.deleteDb();