You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@couchdb.apache.org by da...@apache.org on 2014/07/31 23:43:24 UTC

[34/51] [abbrv] futon commit: updated refs/heads/import-master to 53a86dd

Fix bug in erlang views test

This test was incorrectly relying on a bug in the reduce behavior that
would return a reduce value without ever re-reducing it. The fix is to
just correct the test reduce function to behave properly.

COUCHDB-2001


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

Branch: refs/heads/import-master
Commit: 7b0154f6bebe79a84a76330d652786ebf62ebe62
Parents: e620f7f
Author: Paul J. Davis <pa...@gmail.com>
Authored: Mon Feb 10 15:51:48 2014 -0600
Committer: Paul J. Davis <pa...@gmail.com>
Committed: Mon Feb 10 15:51:48 2014 -0600

----------------------------------------------------------------------
 script/test/erlang_views.js | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/couchdb-futon/blob/7b0154f6/script/test/erlang_views.js
----------------------------------------------------------------------
diff --git a/script/test/erlang_views.js b/script/test/erlang_views.js
index 7eddab4..c6bc5d7 100644
--- a/script/test/erlang_views.js
+++ b/script/test/erlang_views.js
@@ -44,7 +44,10 @@ couchTests.erlang_views = function(debug) {
       // check simple reduction - another doc with same key.
       var doc = {_id: "2", integer: 1, string: "str2"};
       T(db.save(doc).ok);
-      rfun = "fun(Keys, Values, ReReduce) -> length(Values) end.";
+      rfun = 'fun' +
+              ' (_, Values, false) -> length(Values); ' +
+              ' (_, Values, true) -> lists:sum(Values) ' +
+              ' end.';
       results = db.query(mfun, rfun, null, null, "erlang");
       T(results.rows[0].value == 2);