mirror of
https://github.com/wickedest/Mergely.git
synced 2026-02-10 10:17:53 +08:00
17 lines
528 B
JavaScript
17 lines
528 B
JavaScript
const diff = require('../src/diff');
|
|
|
|
describe('diff', () => {
|
|
it('should insert one line when lhs is empty and rhs has no line ending', () => {
|
|
const _diff = new diff('', 'hello', { split: 'lines' });
|
|
const changes = _diff.changes();
|
|
console.log(changes);
|
|
// with lhs_start at 1, the insert is at the end
|
|
expect(changes).to.deep.equal([{
|
|
lhs_start: 1,
|
|
rhs_start: 1,
|
|
lhs_deleted_count: 0,
|
|
rhs_inserted_count: 0
|
|
}]);
|
|
});
|
|
});
|