You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@couchdb.apache.org by ja...@apache.org on 2015/12/16 22:15:03 UTC
[02/50] couchdb commit: updated refs/heads/master to e8e03b6
JS test: update reduce_false.js for 2.0
Project: http://git-wip-us.apache.org/repos/asf/couchdb/repo
Commit: http://git-wip-us.apache.org/repos/asf/couchdb/commit/9de100c9
Tree: http://git-wip-us.apache.org/repos/asf/couchdb/tree/9de100c9
Diff: http://git-wip-us.apache.org/repos/asf/couchdb/diff/9de100c9
Branch: refs/heads/master
Commit: 9de100c9e7d9410be4fbf59a0fa912f123b300e9
Parents: aa76b7c
Author: Jan Lehnardt <ja...@apache.org>
Authored: Wed Dec 16 20:49:31 2015 +0100
Committer: Jan Lehnardt <ja...@apache.org>
Committed: Wed Dec 16 20:49:31 2015 +0100
----------------------------------------------------------------------
test/javascript/tests/reduce_false.js | 11 ++++++++---
1 file changed, 8 insertions(+), 3 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/couchdb/blob/9de100c9/test/javascript/tests/reduce_false.js
----------------------------------------------------------------------
diff --git a/test/javascript/tests/reduce_false.js b/test/javascript/tests/reduce_false.js
index 699b258..81b4c8a 100644
--- a/test/javascript/tests/reduce_false.js
+++ b/test/javascript/tests/reduce_false.js
@@ -11,8 +11,8 @@
// the License.
couchTests.reduce_false = function(debug) {
- var db = new CouchDB("test_suite_db", {"X-Couch-Full-Commit":"false"});
- db.deleteDb();
+ var db_name = get_random_db_name();
+ var db = new CouchDB(db_name, {"X-Couch-Full-Commit":"false"});
db.createDb();
if (debug) debugger;
@@ -33,7 +33,9 @@ couchTests.reduce_false = function(debug) {
// Test that the reduce works
var res = db.view('test/summate');
- T(res.rows.length == 1 && res.rows[0].value == summate(5));
+
+ TEquals(1, res.rows.length, "should have 1 row");
+ TEquals(summate(5), res.rows[0].value, 'should summate up 5');
//Test that we get our docs back
res = db.view('test/summate', {reduce: false});
@@ -41,4 +43,7 @@ couchTests.reduce_false = function(debug) {
for(var i=0; i<5; i++) {
T(res.rows[i].value == i+1);
}
+
+ // cleanup
+ db.deleteDb();
};