8000
We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 76c172b commit 6a3a4b8Copy full SHA for 6a3a4b8
src/algorithms/string/knuth-morris-pratt/__test__/knuthMorrisPratt.test.js
@@ -2,6 +2,9 @@ import knuthMorrisPratt from '../knuthMorrisPratt';
2
3
describe('knuthMorrisPratt', () => {
4
it('should find word position in given text', () => {
5
+ expect(knuthMorrisPratt('', '')).toBe(-1);
6
+ expect(knuthMorrisPratt('a', '')).toBe(-1);
7
+ expect(knuthMorrisPratt('a', 'a')).toBe(0);
8
expect(knuthMorrisPratt('abcbcglx', 'abca')).toBe(-1);
9
expect(knuthMorrisPratt('abcbcglx', 'bcgl')).toBe(3);
10
expect(knuthMorrisPratt('abcxabcdabxabcdabcdabcy', 'abcdabcy')).toBe(15);
0 commit comments