|
| 1 | +import { boyerMoore } from '../BoyerMoore' |
| 2 | + |
| 3 | +describe('Testing the boyer moore algorithm', () => { |
| 4 | + it('Testing with alphabetical strings', () => { |
| 5 | + expect(boyerMoore('THIS IS A TEST TEXT', 'TEST')).toBe(10) |
| 6 | + expect(boyerMoore('AAIOOOAADDZXYCAADAABAABA', 'AADA')).toBe(14) |
| 7 | + expect(boyerMoore('Hello World! This is a test case.', 'Boyer')).toBe(-1) |
| 8 | + }) |
| 9 | + |
| 10 | + it('Testing with alphabets and symbols', () => { |
| 11 | + expect(boyerMoore('AA&&@_OPOODDA##!', '@_')).toBe(4) |
| 12 | + expect(boyerMoore('LK_||{{}}[[$($', '||')).toBe(3) |
| 13 | + expect(boyerMoore('__||{{__+}}[[$($', '-}}')).toBe(-1) |
| 14 | + }) |
| 15 | +}) |
0 commit comments