couchdb-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cml...@apache.org
Subject svn commit: r659589 - /incubator/couchdb/trunk/share/www/script/couch_tests.js
Date Fri, 23 May 2008 16:39:21 GMT
Author: cmlenz
Date: Fri May 23 09:39:21 2008
New Revision: 659589

URL: http://svn.apache.org/viewvc?rev=659589&view=rev
Log:
Add a currently failing test for multiple identical map/reduce view definitions.

Modified:
    incubator/couchdb/trunk/share/www/script/couch_tests.js

Modified: incubator/couchdb/trunk/share/www/script/couch_tests.js
URL: http://svn.apache.org/viewvc/incubator/couchdb/trunk/share/www/script/couch_tests.js?rev=659589&r1=659588&r2=659589&view=diff
==============================================================================
--- incubator/couchdb/trunk/share/www/script/couch_tests.js [utf-8] (original)
+++ incubator/couchdb/trunk/share/www/script/couch_tests.js [utf-8] Fri May 23 09:39:21 2008
@@ -441,7 +441,9 @@
         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 @@
     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) {



Mime
View raw message