summaryrefslogtreecommitdiff
path: root/share
diff options
context:
space:
mode:
authorPaul J. Davis <paul.joseph.davis@gmail.com>2014-02-10 15:51:48 -0600
committerPaul J. Davis <paul.joseph.davis@gmail.com>2014-02-10 15:51:48 -0600
commit1d3d5bc2bef0233e78ecd83d01dc8e41e2620aae (patch)
tree33e711786b407b45638275a5adeaf47d627507ba /share
parent016eb46eb7acc487509da8282bf52c011d54bbb7 (diff)
downloadcouchdb-1d3d5bc2bef0233e78ecd83d01dc8e41e2620aae.tar.gz
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
Diffstat (limited to 'share')
-rw-r--r--share/www/script/test/erlang_views.js5
1 files changed, 4 insertions, 1 deletions
diff --git a/share/www/script/test/erlang_views.js b/share/www/script/test/erlang_views.js
index 7eddab402..c6bc5d710 100644
--- a/share/www/script/test/erlang_views.js
+++ b/share/www/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);