Added tests
This commit is contained in:
parent
85d56733d9
commit
9eab315da9
@ -114,6 +114,7 @@ import "./tests/MS.mjs";
|
|||||||
import "./tests/MultipleBombe.mjs";
|
import "./tests/MultipleBombe.mjs";
|
||||||
import "./tests/MurmurHash3.mjs";
|
import "./tests/MurmurHash3.mjs";
|
||||||
import "./tests/NetBIOS.mjs";
|
import "./tests/NetBIOS.mjs";
|
||||||
|
import "./tests/Ngram.mjs";
|
||||||
import "./tests/NormaliseUnicode.mjs";
|
import "./tests/NormaliseUnicode.mjs";
|
||||||
import "./tests/NTLM.mjs";
|
import "./tests/NTLM.mjs";
|
||||||
import "./tests/OTP.mjs";
|
import "./tests/OTP.mjs";
|
||||||
|
|||||||
34
tests/operations/tests/Ngram.mjs
Normal file
34
tests/operations/tests/Ngram.mjs
Normal file
@ -0,0 +1,34 @@
|
|||||||
|
/**
|
||||||
|
* Ngram tests.
|
||||||
|
*
|
||||||
|
* @author jg42526
|
||||||
|
*
|
||||||
|
* @copyright Crown Copyright 2017
|
||||||
|
* @license Apache-2.0
|
||||||
|
*/
|
||||||
|
import TestRegister from "../../lib/TestRegister.mjs";
|
||||||
|
|
||||||
|
TestRegister.addTests([
|
||||||
|
{
|
||||||
|
name: "Ngram 3",
|
||||||
|
input: "hello",
|
||||||
|
expectedOutput: "hel,ell,llo",
|
||||||
|
recipeConfig: [
|
||||||
|
{
|
||||||
|
op: "N-gram",
|
||||||
|
args: ["3", ","],
|
||||||
|
},
|
||||||
|
],
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: "Ngram longer than input",
|
||||||
|
input: "hello",
|
||||||
|
expectedOutput: "",
|
||||||
|
recipeConfig: [
|
||||||
|
{
|
||||||
|
op: "N-gram",
|
||||||
|
args: ["6", ","],
|
||||||
|
},
|
||||||
|
],
|
||||||
|
},
|
||||||
|
]);
|
||||||
Loading…
x
Reference in New Issue
Block a user