Skip to content

Commit 7c24a20

Browse files
Add test for bug #553
1 parent e80648d commit 7c24a20

File tree

1 file changed

+27
-0
lines changed

1 file changed

+27
-0
lines changed

test/diff/word.js

+27
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,33 @@ describe('WordDiff', function() {
3131
'.'
3232
]);
3333
});
34+
35+
// Test for bug reported at https://github.com/kpdecker/jsdiff/issues/553
36+
it('should treat numbers as part of a word if not separated by whitespace or punctuation', () => {
37+
expect(
38+
wordDiff.tokenize(
39+
'Tea Too, also known as T2, had revenue of 57m AUD in 2012-13.'
40+
)
41+
).to.deep.equal([
42+
'Tea ',
43+
' Too',
44+
', ',
45+
' also ',
46+
' known ',
47+
' as ',
48+
' T2',
49+
', ',
50+
' had ',
51+
' revenue ',
52+
' of ',
53+
' 57m ',
54+
' AUD ',
55+
' in ',
56+
' 2012',
57+
'-',
58+
'2013'
59+
]);
60+
});
3461
});
3562

3663
describe('#diffWords', function() {

0 commit comments

Comments
 (0)