summaryrefslogtreecommitdiff
path: root/share
diff options
context:
space:
mode:
authorChristopher Lenz <cmlenz@apache.org>2008-05-23 16:39:21 +0000
committerChristopher Lenz <cmlenz@apache.org>2008-05-23 16:39:21 +0000
commitda666b43ed1f2f28223fd5eb6568f5df60b0547e (patch)
tree7882f48d45093d8dc90f8b27dfebdc24e0c0d804 /share
parent87e11f55ecf0c87bdd36906bf7d662cd091cf3e6 (diff)
Add a currently failing test for multiple identical map/reduce view definitions.
git-svn-id: https://svn.apache.org/repos/asf/incubator/couchdb/trunk@659589 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'share')
-rw-r--r--share/www/script/couch_tests.js12
1 files changed, 8 insertions, 4 deletions
diff --git a/share/www/script/couch_tests.js b/share/www/script/couch_tests.js
index 43dd6551..8ec727e7 100644
--- a/share/www/script/couch_tests.js
+++ b/share/www/script/couch_tests.js
@@ -441,7 +441,9 @@ var tests = {
no_docs: {map: "function(doc) {}"},
single_doc: {map: "function(doc) { if (doc._id == \"1\") { emit(1, null) }}"},
summate: {map:"function (doc) {emit(doc.integer, doc.integer)};",
- reduce:"function (keys, values) { return sum(values); };"}
+ reduce:"function (keys, values) { return sum(values); };"},
+ summate2: {map:"function (doc) {emit(doc.integer, doc.integer)};",
+ reduce:"function (keys, values) { return sum(values); };"}
}
}
T(db.save(designDoc).ok);
@@ -464,15 +466,17 @@ var tests = {
T(result == summate(numDocs));
result = db.view("test/summate", {startkey:4,endkey:4}).result;
-
T(result == 4);
result = db.view("test/summate", {startkey:4,endkey:5}).result;
-
T(result == 9);
- result =db.view("test/summate", {startkey:4,endkey:6}).result;
+ result = db.view("test/summate", {startkey:4,endkey:6}).result;
+ T(result == 15);
+ // Verify that a shared index (view def is an exact copy of "summate")
+ // does not confuse the reduce stage
+ result = db.view("test/summate2", {startkey:4,endkey:6}).result;
T(result == 15);
for(var i=1; i<numDocs/2; i+=30) {