Skip to content

Commit

Permalink
Add test case for array should generate replace
Browse files Browse the repository at this point in the history
Signed-off-by: Manish Bhatia <[email protected]>
  • Loading branch information
Manish Bhatia committed Jan 31, 2020
1 parent 3f8230f commit 90b3454
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions test/jiff-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,15 @@ buster.testCase('jiff', {
}
}
}
},
'should generate replace': function() {
var a = [1, 2];
var b = [3, 2];

var patch = jiff.diff(a, b, { invertible: false });
assert.equals(patch.length, 1);
assert.equals(patch[0].op, 'replace');
assert.equals(b, jiff.patch(patch, a));
}
},

Expand Down

0 comments on commit 90b3454

Please sign in to comment.