couchdb-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From j..@apache.org
Subject [1/9] couchdb commit: updated refs/heads/master to 01edf89
Date Mon, 25 Apr 2016 16:56:06 GMT
Repository: couchdb
Updated Branches:
  refs/heads/master 17bbf2619 -> 01edf892e


Bring multi key design test back


Project: http://git-wip-us.apache.org/repos/asf/couchdb/repo
Commit: http://git-wip-us.apache.org/repos/asf/couchdb/commit/6c4f3d9a
Tree: http://git-wip-us.apache.org/repos/asf/couchdb/tree/6c4f3d9a
Diff: http://git-wip-us.apache.org/repos/asf/couchdb/diff/6c4f3d9a

Branch: refs/heads/master
Commit: 6c4f3d9a841cc0f10c2235eb807461eda9497a6d
Parents: 0eac44c
Author: sebastianro <sebastianro@apache.org>
Authored: Fri Apr 15 18:37:35 2016 +0200
Committer: sebastianro <sebastianro@apache.org>
Committed: Sat Apr 23 19:22:36 2016 +0200

----------------------------------------------------------------------
 test/javascript/tests/view_multi_key_design.js | 60 ++++++++++++---------
 1 file changed, 35 insertions(+), 25 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/couchdb/blob/6c4f3d9a/test/javascript/tests/view_multi_key_design.js
----------------------------------------------------------------------
diff --git a/test/javascript/tests/view_multi_key_design.js b/test/javascript/tests/view_multi_key_design.js
index 12be7b5..a50d1fb 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();


Mime
View raw message