diff --git a/src/algorithms/string/knuth-morris-pratt/__test__/knuthMorrisPratt.test.js b/src/algorithms/string/knuth-morris-pratt/__test__/knuthMorrisPratt.test.js index 5b47e72a..42e6f81c 100644 --- a/src/algorithms/string/knuth-morris-pratt/__test__/knuthMorrisPratt.test.js +++ b/src/algorithms/string/knuth-morris-pratt/__test__/knuthMorrisPratt.test.js @@ -2,6 +2,9 @@ import knuthMorrisPratt from '../knuthMorrisPratt'; describe('knuthMorrisPratt', () => { it('should find word position in given text', () => { + expect(knuthMorrisPratt('', '')).toBe(-1); + expect(knuthMorrisPratt('a', '')).toBe(-1); + expect(knuthMorrisPratt('a', 'a')).toBe(0); expect(knuthMorrisPratt('abcbcglx', 'abca')).toBe(-1); expect(knuthMorrisPratt('abcbcglx', 'bcgl')).toBe(3); expect(knuthMorrisPratt('abcxabcdabxabcdabcdabcy', 'abcdabcy')).toBe(15);