summaryrefslogtreecommitdiff
path: root/share
diff options
context:
space:
mode:
authorJohn Christopher Anderson <jchris@apache.org>2008-12-16 21:19:03 +0000
committerJohn Christopher Anderson <jchris@apache.org>2008-12-16 21:19:03 +0000
commit3b27d154b2f36ff7a7514a6b0dbd29dd3715193b (patch)
tree0e5b25b2eaad36997dd7b79c0fe709eaaf157f32 /share
parent287dce73d2ededa4abb5f8c80599032dace46268 (diff)
fix COUCHDB-177. thanks Paul Carey and Paul Davis
git-svn-id: https://svn.apache.org/repos/asf/couchdb/trunk@727156 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'share')
-rw-r--r--share/www/script/couch_tests.js11
1 files changed, 10 insertions, 1 deletions
diff --git a/share/www/script/couch_tests.js b/share/www/script/couch_tests.js
index 78b0c302..0ad6eee0 100644
--- a/share/www/script/couch_tests.js
+++ b/share/www/script/couch_tests.js
@@ -1344,6 +1344,15 @@ var tests = {
}
T(db.save(designDoc).ok);
+ // Test that missing keys work too
+ var keys = [101,30,15,37,50]
+ var reduce = db.view("test/summate",{group:true},keys).rows;
+ T(reduce.length == keys.length-1); // 101 is missing
+ for(var i=0; i<reduce.length; i++) {
+ T(keys.indexOf(reduce[i].key) != -1);
+ T(reduce[i].key == reduce[i].value);
+ }
+
// First, the goods:
var keys = [10,15,30,37,50];
var rows = db.view("test/all_docs",{},keys).rows;
@@ -1356,7 +1365,7 @@ var tests = {
T(reduce.length == keys.length);
for(var i=0; i<reduce.length; i++) {
T(keys.indexOf(reduce[i].key) != -1);
- T(rows[i].key == rows[i].value);
+ T(reduce[i].key == reduce[i].value);
}
// Test that invalid parameter combinations get rejected