Skip to content

Commit

Permalink
Add test for bug #553
Browse files Browse the repository at this point in the history
  • Loading branch information
ExplodingCabbage committed Sep 5, 2024
1 parent e80648d commit bed093c
Showing 1 changed file with 28 additions and 0 deletions.
28 changes: 28 additions & 0 deletions test/diff/word.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,34 @@ describe('WordDiff', function() {
'.'
]);
});

// Test for bug reported at https://github.com/kpdecker/jsdiff/issues/553
it('should treat numbers as part of a word if not separated by whitespace or punctuation', () => {
expect(
wordDiff.tokenize(
'Tea Too, also known as T2, had revenue of 57m AUD in 2012-13.'
)
).to.deep.equal([
'Tea ',
' Too',
', ',
' also ',
' known ',
' as ',
' T2',
', ',
' had ',
' revenue ',
' of ',
' 57m ',
' AUD ',
' in ',
' 2012',
'-',
'13',
'.'
]);
});
});

describe('#diffWords', function() {
Expand Down

0 comments on commit bed093c

Please sign in to comment.