Skip to content

Commit b77c0a1

Browse files
committed
fix(LevenshteinDistance.test.js): Fixed broken test
1 parent 7992caa commit b77c0a1

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

String/LevenshteinDistance.test.js

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import levenshteinDistance from './LevenshteinDistance'
1+
import { levenshteinDistance } from './LevenshteinDistance'
22

33
describe('levenshteinDistance', () => {
44
it('should calculate edit distance between two strings', () => {
@@ -14,13 +14,13 @@ describe('levenshteinDistance', () => {
1414
// Should just substitute i with o, m with g and insert e at end
1515
expect(levenshteinDistance('firm', 'forge')).toBe(3)
1616

17-
// Should just substitute i with s, g with i, h with t and delete f from front
18-
expect(levenshteinDistance('fighting', 'sitting')).toBe(4)
17+
// Should just substitute f with s, g with t and delete h
18+
expect(levenshteinDistance('fighting', 'sitting')).toBe(3)
1919

2020
// Should add 4 letters b, a, s and e at the beginning.
2121
expect(levenshteinDistance('ball', 'baseball')).toBe(4)
2222

23-
// Should delete 4 letters b, a, s and e at the beginning.
24-
expect(levenshteinDistance('baseball', 'foot')).toBe(4)
23+
// Should delete 4 letters b, a, s and e at the beginning and replace the last 4 with f, o, o, t
24+
expect(levenshteinDistance('baseball', 'foot')).toBe(8)
2525
})
2626
})

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy