forked from kpdecker/jsdiff
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsentence.js
More file actions
18 lines (15 loc) · 791 Bytes
/
Copy pathsentence.js
File metadata and controls
18 lines (15 loc) · 791 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
import {diffSentences} from '../../lib/diff/sentence';
import {convertChangesToXML} from '../../lib/convert/xml';
import {expect} from 'chai';
describe('diff/sentence', function() {
describe('#diffSentences', function() {
it('Should diff Sentences', function() {
const diffResult = diffSentences('New Value.', 'New ValueMoreData.');
expect(convertChangesToXML(diffResult)).to.equal('<del>New Value.</del><ins>New ValueMoreData.</ins>');
});
it('should diff only the last sentence', function() {
const diffResult = diffSentences('Here im. Rock you like old man.', 'Here im. Rock you like hurricane.');
expect(convertChangesToXML(diffResult)).to.equal('Here im. <del>Rock you like old man.</del><ins>Rock you like hurricane.</ins>');
});
});
});