mirror of
https://github.moeyy.xyz/https://github.com/trekhleb/javascript-algorithms.git
synced 2024-12-26 07:01:18 +08:00
Add unicode based tests for RabinKarp.
This commit is contained in:
parent
e7d22b4883
commit
b3a503aa6d
@ -37,6 +37,7 @@ describe('rabinKarp', () => {
|
|||||||
it('should work with UTF symbols', () => {
|
it('should work with UTF symbols', () => {
|
||||||
expect(rabinKarp('a\u{ffff}', '\u{ffff}')).toBe(1);
|
expect(rabinKarp('a\u{ffff}', '\u{ffff}')).toBe(1);
|
||||||
expect(rabinKarp('\u0000耀\u0000', '耀\u0000')).toBe(1);
|
expect(rabinKarp('\u0000耀\u0000', '耀\u0000')).toBe(1);
|
||||||
// expect(rabinKarp('a\u{10000}', '\u{10000}')).toBe(1);
|
expect(rabinKarp('a\u{20000}', '\u{20000}')).toBe(1);
|
||||||
|
expect(rabinKarp('ab\u{20005}a', '\u{20005}a')).toBe(2);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
Loading…
Reference in New Issue
Block a user