UNPKG

javascript-algorithms-and-data-structures

Version:

Algorithms and data-structures implemented on JavaScript

12 lines (10 loc) 489 B
import longestCommonSubstring from '../longestCommonSubstring'; describe('longestCommonSubstring', () => { it('should find longest common substring between two strings', () => { expect(longestCommonSubstring('', '')).toBe(''); expect(longestCommonSubstring('ABC', '')).toBe(''); expect(longestCommonSubstring('', 'ABC')).toBe(''); expect(longestCommonSubstring('ABABC', 'BABCA')).toBe('BABC'); expect(longestCommonSubstring('BABCA', 'ABCBA')).toBe('ABC'); }); });