You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@couchdb.apache.org by fd...@apache.org on 2010/08/20 13:26:29 UTC

svn commit: r987457 - /couchdb/trunk/share/www/script/test/replication.js

Author: fdmanana
Date: Fri Aug 20 11:26:28 2010
New Revision: 987457

URL: http://svn.apache.org/viewvc?rev=987457&view=rev
Log:
Allow the replication.js test to be run outside a browser environment.
Closes COUCHDB-862.

Thanks Bob Dionne.


Modified:
    couchdb/trunk/share/www/script/test/replication.js

Modified: couchdb/trunk/share/www/script/test/replication.js
URL: http://svn.apache.org/viewvc/couchdb/trunk/share/www/script/test/replication.js?rev=987457&r1=987456&r2=987457&view=diff
==============================================================================
--- couchdb/trunk/share/www/script/test/replication.js (original)
+++ couchdb/trunk/share/www/script/test/replication.js Fri Aug 20 11:26:28 2010
@@ -399,24 +399,25 @@ couchTests.replication = function(debug)
       var valid_doc_ids = [];
       var invalid_doc_ids = [];
 
-      $.each(doc_ids, function(index, id) {
-        var found = false;
-
-        for (var k = 0; k < all_docs.length; k++) {
-          var doc = all_docs[k];
-
-          if (id === doc._id) {
-            found = true;
-            break;
-          }
-        }
-
-        if (found) {
-          valid_doc_ids.push(id);
-        } else {
-          invalid_doc_ids.push(id);
-        }
-      });
+        for (var p = 0; p < doc_ids.length; p++) {
+            var id = doc_ids[p];
+            var found = false;
+
+            for (var k = 0; k < all_docs.length; k++) {
+                var doc = all_docs[k];
+
+                if (id === doc._id) {
+                    found = true;
+                    break;
+                }
+            }
+
+            if (found) {
+                valid_doc_ids.push(id);
+            } else {
+                invalid_doc_ids.push(id);
+            }
+        };
 
       dbB.deleteDb();
       dbB.createDb();
@@ -434,7 +435,7 @@ couchTests.replication = function(debug)
         var doc = all_docs[k];
         var tgt_doc = dbB.open(doc._id);
 
-        if ($.inArray(doc._id, doc_ids) >= 0) {
+        if (doc_ids.indexOf(doc._id) >= 0) {
           T(tgt_doc !== null);
           T(tgt_doc.value === doc.value);
         } else {
@@ -506,7 +507,7 @@ couchTests.replication = function(debug)
     });
 
     T(repResult.ok);
-    T($.isArray(repResult.history));
+    T(repResult.history instanceof Array);
     T(repResult.history.length === 1);
     T(repResult.history[0].docs_written === 2);
     T(repResult.history[0].docs_read === 2);