couchdb-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From j..@apache.org
Subject [03/50] couchdb commit: updated refs/heads/master to e8e03b6
Date Wed, 16 Dec 2015 21:15:04 GMT
JS test: update reduce_builtin.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/aa76b7c4
Tree: http://git-wip-us.apache.org/repos/asf/couchdb/tree/aa76b7c4
Diff: http://git-wip-us.apache.org/repos/asf/couchdb/diff/aa76b7c4

Branch: refs/heads/master
Commit: aa76b7c4838c2b6a5b0139c761cc2ec34f73b3ac
Parents: 8cae10f
Author: Jan Lehnardt <jan@apache.org>
Authored: Wed Dec 16 20:49:31 2015 +0100
Committer: Jan Lehnardt <jan@apache.org>
Committed: Wed Dec 16 20:49:31 2015 +0100

----------------------------------------------------------------------
 test/javascript/tests/reduce_builtin.js | 12 +++++++++---
 1 file changed, 9 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/couchdb/blob/aa76b7c4/test/javascript/tests/reduce_builtin.js
----------------------------------------------------------------------
diff --git a/test/javascript/tests/reduce_builtin.js b/test/javascript/tests/reduce_builtin.js
index b3cc3cc..9c455e4 100644
--- a/test/javascript/tests/reduce_builtin.js
+++ b/test/javascript/tests/reduce_builtin.js
@@ -11,8 +11,8 @@
 // the License.
 
 couchTests.reduce_builtin = 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;
 
@@ -94,6 +94,8 @@ couchTests.reduce_builtin = function(debug) {
   }
 
   db.deleteDb();
+  db_name = get_random_db_name();
+  db = new CouchDB(db_name, {"X-Couch-Full-Commit":"false"});
   db.createDb();
 
   for(var i=1; i <= 5; i++) {
@@ -113,7 +115,8 @@ couchTests.reduce_builtin = function(debug) {
       docs.push({keys:["d", "b"]});
       docs.push({keys:["d", "c"]});
       db.bulkSave(docs);
-      T(db.info().doc_count == ((i - 1) * 10 * 11) + ((j + 1) * 11));
+      var total_docs = ((i - 1) * 10 * 11) + ((j + 1) * 11);
+      TEquals(total_docs, db.info().doc_count, 'doc count should match');
     }
 
     map = function (doc) { emit(doc.keys, 1); };
@@ -176,4 +179,7 @@ couchTests.reduce_builtin = function(debug) {
     T(equals(results.rows[5], {key:["d","b"],value:[10*i,10*i]}));
     T(equals(results.rows[6], {key:["d","c"],value:[10*i,10*i]}));
   }
+
+  // cleanup
+  db.deleteDb();
 }


Mime
View raw message