summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJan Lehnardt <jan@apache.org>2015-12-16 20:49:31 +0100
committerJan Lehnardt <jan@apache.org>2015-12-16 20:49:31 +0100
commit9de100c9e7d9410be4fbf59a0fa912f123b300e9 (patch)
treed8c9fda537582b851fca68117356828267c5800d
parentaa76b7c4838c2b6a5b0139c761cc2ec34f73b3ac (diff)
downloadcouchdb-9de100c9e7d9410be4fbf59a0fa912f123b300e9.tar.gz
JS test: update reduce_false.js for 2.0
-rw-r--r--test/javascript/tests/reduce_false.js11
1 files changed, 8 insertions, 3 deletions
diff --git a/test/javascript/tests/reduce_false.js b/test/javascript/tests/reduce_false.js
index 699b258f9..81b4c8a4f 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();
};