mirror of
https://github.com/SukkaW/Surge.git
synced 2026-01-29 01:51:52 +08:00
Housekeeping
This commit is contained in:
@@ -1,17 +1,17 @@
|
||||
import { describe, it } from 'mocha';
|
||||
import { expect } from 'chai';
|
||||
import { expect } from 'expect';
|
||||
import createKeywordFilter from './aho-corasick';
|
||||
|
||||
describe('AhoCorasick', () => {
|
||||
it('basic', () => {
|
||||
let kwfilter = createKeywordFilter(['ap', 'an']);
|
||||
expect(kwfilter('bananan')).to.equal(true);
|
||||
expect(kwfilter('apple')).to.equal(true);
|
||||
expect(kwfilter('melon')).to.equal(false);
|
||||
expect(kwfilter('bananan')).toBe(true);
|
||||
expect(kwfilter('apple')).toBe(true);
|
||||
expect(kwfilter('melon')).toBe(false);
|
||||
|
||||
kwfilter = createKeywordFilter(['cdn', 'sukka']);
|
||||
expect(kwfilter('bananan')).to.equal(false);
|
||||
expect(kwfilter('apple')).to.equal(false);
|
||||
expect(kwfilter('melon')).to.equal(false);
|
||||
expect(kwfilter('bananan')).toBe(false);
|
||||
expect(kwfilter('apple')).toBe(false);
|
||||
expect(kwfilter('melon')).toBe(false);
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user