From b3a503aa6db8eff39b1cab3523b804f91aa870f7 Mon Sep 17 00:00:00 2001 From: Oleksii Trekhleb Date: Thu, 9 Aug 2018 06:10:47 +0300 Subject: [PATCH] Add unicode based tests for RabinKarp. --- src/algorithms/string/rabin-karp/__test__/rabinKarp.test.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/algorithms/string/rabin-karp/__test__/rabinKarp.test.js b/src/algorithms/string/rabin-karp/__test__/rabinKarp.test.js index ba759536..2a20ecbc 100644 --- a/src/algorithms/string/rabin-karp/__test__/rabinKarp.test.js +++ b/src/algorithms/string/rabin-karp/__test__/rabinKarp.test.js @@ -37,6 +37,7 @@ describe('rabinKarp', () => { it('should work with UTF symbols', () => { expect(rabinKarp('a\u{ffff}', '\u{ffff}')).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); }); });