From 02f562d297d00c61d74a43de8696873667742a10 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Hanno=20J=2E=20G=C3=B6decke?= Date: Thu, 26 Sep 2024 14:27:37 +0200 Subject: [PATCH] add unit test --- tests/unit/SuffixUkkonenTree.ts | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/tests/unit/SuffixUkkonenTree.ts b/tests/unit/SuffixUkkonenTree.ts index 3e4cfbbe3172..0c6297dd9a56 100644 --- a/tests/unit/SuffixUkkonenTree.ts +++ b/tests/unit/SuffixUkkonenTree.ts @@ -12,4 +12,8 @@ describe('SuffixUkkonenTree', () => { tree.build(); expect(tree.findSubstring(stringToNumeric('an'))).toEqual(expect.arrayContaining([1, 3, 8, 10])); }); + + it('should convert string to numeric with a list of chars to skip', () => { + expect(stringToNumeric('abcabc', new Set(['b']))).toEqual([0, 2, 0, 2]); + }); });