diff options
Diffstat (limited to 'share/www/script/test/reduce_builtin.js')
-rw-r--r-- | share/www/script/test/reduce_builtin.js | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/share/www/script/test/reduce_builtin.js b/share/www/script/test/reduce_builtin.js index 7b8207ad..b3cc3cc7 100644 --- a/share/www/script/test/reduce_builtin.js +++ b/share/www/script/test/reduce_builtin.js @@ -16,7 +16,7 @@ couchTests.reduce_builtin = function(debug) { db.createDb(); if (debug) debugger; - var numDocs = 500 + var numDocs = 500; var docs = makeDocs(1,numDocs + 1); db.bulkSave(docs); @@ -28,13 +28,14 @@ couchTests.reduce_builtin = function(debug) { acc += i*i; } return acc; - } + }; // this is the same test as the reduce.js test // only we'll let CouchDB run reduce in Erlang var map = function (doc) { emit(doc.integer, doc.integer); - emit(doc.integer, doc.integer)}; + emit(doc.integer, doc.integer); + }; var result = db.query(map, "_sum"); T(result.rows[0].value == 2*summate(numDocs)); @@ -115,7 +116,7 @@ couchTests.reduce_builtin = function(debug) { T(db.info().doc_count == ((i - 1) * 10 * 11) + ((j + 1) * 11)); } - map = function (doc) {emit(doc.keys, 1)}; + map = function (doc) { emit(doc.keys, 1); }; // with emitted values being 1, count should be the same as sum var builtins = ["_sum", "_count"]; @@ -150,7 +151,7 @@ couchTests.reduce_builtin = function(debug) { T(equals(results.rows[6], {key:["d","c"],value:10*i})); }; - map = function (doc) {emit(doc.keys, [1, 1])}; + map = function (doc) { emit(doc.keys, [1, 1]); }; var results = db.query(map, "_sum", {group:true}); T(equals(results.rows[0], {key:["a"],value:[20*i,20*i]})); |