mirror of
https://github.com/SukkaW/Surge.git
synced 2025-12-12 01:00:34 +08:00
13 lines
405 B
TypeScript
13 lines
405 B
TypeScript
// eslint-disable-next-line import/no-unresolved -- bun
|
|
import { describe, expect, it } from 'bun:test';
|
|
import createKeywordFilter from './aho-corasick';
|
|
|
|
describe('AhoCorasick', () => {
|
|
it('basic', () => {
|
|
const kwfilter = createKeywordFilter(['ap', 'an']);
|
|
expect(kwfilter('bananan')).toBeTrue();
|
|
expect(kwfilter('apple')).toBeTrue();
|
|
expect(kwfilter('melon')).toBeFalse();
|
|
});
|
|
});
|