|
1 | 1 | import { calculateLevenshteinDp } from '../LevenshteinDistance'
|
2 | 2 |
|
3 | | -test('Add and remove letters at the beginning and the end while making replacements', () => { |
| 3 | +test('Should return the distance counting additions and removals', () => { |
4 | 4 | const from = 'kitten'
|
5 | 5 | const to = 'sitting'
|
6 | 6 | expect(calculateLevenshteinDp(from, to)).toBe(3)
|
7 | 7 | })
|
8 | 8 |
|
9 | | -test('Replace contiguous letters at the middle of the words', () => { |
| 9 | +test('Should return the distance based on replacements in the middle of the strings', () => { |
10 | 10 | const from = 'book'
|
11 | 11 | const to = 'back'
|
12 | 12 | expect(calculateLevenshteinDp(from, to)).toBe(2)
|
13 | 13 | })
|
14 | 14 |
|
15 | | -test('Compare properly strings with different length', () => { |
| 15 | +test('Should return the distance for strings with different length', () => { |
16 | 16 | const from = 'sunday'
|
17 | 17 | const to = 'saturday'
|
18 | 18 | expect(calculateLevenshteinDp(from, to)).toBe(3)
|
|
0 commit comments