changesets
Advanced tools
Comparing version 0.2.3 to 0.2.4
@@ -5,3 +5,3 @@ { | ||
"description": "A Changeset library incorporating an operational transformation (OT) algorithm -- for node and the browser!", | ||
"version": "0.2.3", | ||
"version": "0.2.4", | ||
"keywords": [ | ||
@@ -8,0 +8,0 @@ "operational transformation", |
@@ -206,3 +206,3 @@ /*! | ||
if(packed == '') return new Changeset | ||
var matches = packed.match(/(\+|-)\w+?:[^:]+?:\w+?/g) | ||
var matches = packed.match(/(\+|-)\w+?:[^:]+?:\w+/g) | ||
if(!matches) throw new Error('Cannot unpack invalid serialized changeset string') | ||
@@ -209,0 +209,0 @@ |
{ | ||
"name": "changesets", | ||
"version": "0.2.3", | ||
"version": "0.2.4", | ||
"description": "A Changeset library incorporating an operational transformation (OT) algorithm -- for node and the browser!", | ||
@@ -5,0 +5,0 @@ "repository": { |
@@ -152,2 +152,23 @@ /*! | ||
suite.addBatch({ | ||
'accessories': | ||
{ topic: function() { | ||
return [engine.constructChangeset("1234", "1234b", 521), engine.constructChangeset("1234", "1234a", 834)] | ||
} | ||
, 'should cause the same outcome ragardless of the transformation order': function(er, cs) { | ||
var text1 = cs[0].transformAgainst(cs[1]).apply( cs[1].apply("1234") ) | ||
var text2 = cs[1].transformAgainst(cs[0]).apply( cs[0].apply("1234") ) | ||
console.log(text1, text2) | ||
assert.equal(text1, text2) | ||
} | ||
, 'should be the same after packing and unpacking': function(er, cs) { | ||
var acc1 = cs[0][0].accessory | ||
, acc2 = engine.Changeset.unpack(cs[0].pack())[0].accessory | ||
console.log(acc1, acc2) | ||
assert.equal(acc2, acc1) | ||
} | ||
} | ||
}) | ||
suite.export(module) |
154778
3964
15