Permalink
Browse files

Added test for DMP formatting (and fixed a comma typo)

  • Loading branch information...
1 parent b88c91d commit 6b72ccc103ce731275a721a4f6622113b4ed3e75 @zzen committed Apr 5, 2012
Showing with 10 additions and 1 deletion.
  1. +1 −1 diff.js
  2. +9 −0 test/diffTest.js
View
@@ -278,7 +278,7 @@ var JsDiff = (function() {
}
}
return ret.join("");
- }
+ },
convertChangesToDMP: function(changes){
var ret = [], change;
View
@@ -614,3 +614,12 @@ exports['Patch'] = function() {
diffResult,
"Patch same diffResult Value");
};
+
+exports['convertToDMP'] = function() {
+ diffResult = diff.diffWords("New Value ", "New ValueMoreData ");
+
+ assert.deepEqual(
+ [[0,'New '],[1,'ValueMoreData'],[-1,'Value'],[0,' ']],
+ diff.convertChangesToDMP(diffResult),
+ "DMP conversion of diffResult");
+};

0 comments on commit 6b72ccc

Please sign in to comment.