forked from kpdecker/jsdiff
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcharacter.js
More file actions
25 lines (21 loc) · 978 Bytes
/
Copy pathcharacter.js
File metadata and controls
25 lines (21 loc) · 978 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
import {diffChars} from '../../lib/diff/character';
import {convertChangesToXML} from '../../lib/convert/xml';
import {expect} from 'chai';
describe('diff/character', function() {
describe('#diffChars', function() {
it('Should diff chars', function() {
const diffResult = diffChars('New Value.', 'New ValueMoreData.');
expect(convertChangesToXML(diffResult)).to.equal('New Value<ins>MoreData</ins>.');
});
describe('case insensitivity', function() {
it("is considered when there's no difference", function() {
const diffResult = diffChars('New Value.', 'New value.', {ignoreCase: true});
expect(convertChangesToXML(diffResult)).to.equal('New value.');
});
it("is considered when there's a difference", function() {
const diffResult = diffChars('New Values.', 'New value.', {ignoreCase: true});
expect(convertChangesToXML(diffResult)).to.equal('New value<del>s</del>.');
});
});
});
});