Skip to content

Commit bed093c

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

File tree

1 file changed

+28
-0
lines changed

1 file changed

+28
-0
lines changed

test/diff/word.js

+28
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,34 @@ 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+
'13',
59+
'.'
60+
]);
61+
});
3462
});
3563

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

0 commit comments

Comments
 (0)