Permalink
Browse files

test replication

  • Loading branch information...
1 parent 1ff51df commit c5784c949548b9fb995f21f249c692f958ea0c62 @dominictarr committed Dec 7, 2012
Showing with 31 additions and 0 deletions.
  1. +31 −0 test/replicate.js
View
@@ -0,0 +1,31 @@
+require('tape')('test', function (t) {
+var RArray = require('..')
+
+var a = new RArray()
+var b = new RArray()
+var s;
+
+//pipe instances together...
+(s =a.createStream())
+ .pipe(b.createStream())
+ .pipe(s)
+
+//see https://github.com/dominictarr/scuttlebutt
+
+a.splice(0, 0, 'A', 'B', 'C', 'D')
+
+b.push('hello!')
+// console.log(b.toJSON())
+
+process.nextTick(function () {
+ console.log('a', a.store, a.keys)
+ console.log(a.toJSON())
+ console.log('b', b.store, b.keys)
+ console.log(b.toJSON())
+ t.deepEqual(a.toJSON(), b.toJSON())
+ t.end()
+})
+
+
+})
+

0 comments on commit c5784c9

Please sign in to comment.