You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@couchdb.apache.org by ja...@apache.org on 2012/12/19 18:28:51 UTC

[6/6] git commit: Add test cases for empty keys query parameter

Add test cases for empty keys query parameter


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

Branch: refs/heads/1.2.x
Commit: cf10ab14aa1fc1742666ca54915ea4ae3235ee97
Parents: 6637c7f
Author: Adam Lofts <Ad...@gmail.com>
Authored: Sun May 20 14:12:03 2012 +0100
Committer: Jan Lehnardt <ja...@apache.org>
Committed: Wed Dec 19 17:01:38 2012 +0100

----------------------------------------------------------------------
 share/www/script/test/view_multi_key_all_docs.js |    4 ++++
 share/www/script/test/view_multi_key_design.js   |    4 ++++
 share/www/script/test/view_multi_key_temp.js     |    3 +++
 3 files changed, 11 insertions(+), 0 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/couchdb/blob/cf10ab14/share/www/script/test/view_multi_key_all_docs.js
----------------------------------------------------------------------
diff --git a/share/www/script/test/view_multi_key_all_docs.js b/share/www/script/test/view_multi_key_all_docs.js
index 1113be4..7c7f6f8 100644
--- a/share/www/script/test/view_multi_key_all_docs.js
+++ b/share/www/script/test/view_multi_key_all_docs.js
@@ -88,4 +88,8 @@ couchTests.view_multi_key_all_docs = function(debug) {
   T(rows[1].error == "not_found");
   T(!rows[1].id);
   T(rows[2].id == rows[2].key && rows[2].key == "0");
+
+  // empty keys
+  rows = db.allDocs({keys: []}, null).rows;
+  T(rows.length == 0);
 };

http://git-wip-us.apache.org/repos/asf/couchdb/blob/cf10ab14/share/www/script/test/view_multi_key_design.js
----------------------------------------------------------------------
diff --git a/share/www/script/test/view_multi_key_design.js b/share/www/script/test/view_multi_key_design.js
index 3839695..a84d07a 100644
--- a/share/www/script/test/view_multi_key_design.js
+++ b/share/www/script/test/view_multi_key_design.js
@@ -61,6 +61,10 @@ couchTests.view_multi_key_design = function(debug) {
     T(rows[i].key == rows[i].value);
   }
 
+  // with empty keys
+  rows = db.view("test/all_docs",{keys:[]},null).rows;
+  T(rows.length == 0);
+
   var reduce = db.view("test/summate",{group:true},keys).rows;
   T(reduce.length == keys.length);
   for(var i=0; i<reduce.length; i++) {

http://git-wip-us.apache.org/repos/asf/couchdb/blob/cf10ab14/share/www/script/test/view_multi_key_temp.js
----------------------------------------------------------------------
diff --git a/share/www/script/test/view_multi_key_temp.js b/share/www/script/test/view_multi_key_temp.js
index 55eefda..3c05409 100644
--- a/share/www/script/test/view_multi_key_temp.js
+++ b/share/www/script/test/view_multi_key_temp.js
@@ -34,4 +34,7 @@ couchTests.view_multi_key_temp = function(debug) {
     T(keys.indexOf(reduce[i].key) != -1);
     T(reduce[i].key == reduce[i].value);
   }
+
+  rows = db.query(queryFun, null, {}, []).rows;
+  T(rows.length == 0);
 };