From a6732ba81524fc34e2ce58a1dff7304f3ac1c31f Mon Sep 17 00:00:00 2001 From: George O <16269580+Ge0rg3@users.noreply.github.com> Date: Sat, 8 Jun 2019 21:49:31 +0100 Subject: [PATCH] Added Index of Coincidence Tests --- tests/operations/index.mjs | 1 + tests/operations/tests/IndexOfCoincidence.mjs | 22 +++++++++++++++++++ 2 files changed, 23 insertions(+) create mode 100644 tests/operations/tests/IndexOfCoincidence.mjs diff --git a/tests/operations/index.mjs b/tests/operations/index.mjs index 41d78c35..e40a5bd9 100644 --- a/tests/operations/index.mjs +++ b/tests/operations/index.mjs @@ -49,6 +49,7 @@ import "./tests/Hash"; import "./tests/HaversineDistance"; import "./tests/Hexdump"; import "./tests/Image"; +import "./tests/IndexOfCoincidence"; import "./tests/Jump"; import "./tests/JSONBeautify"; import "./tests/JSONMinify"; diff --git a/tests/operations/tests/IndexOfCoincidence.mjs b/tests/operations/tests/IndexOfCoincidence.mjs new file mode 100644 index 00000000..3dc4cd35 --- /dev/null +++ b/tests/operations/tests/IndexOfCoincidence.mjs @@ -0,0 +1,22 @@ +/** + * Index of Coincidence tests. + * + * @author George O [georgeomnet+cyberchef@gmail.com] + * @copyright Crown Copyright 2019 + * @license Apache-2.0 + */ +import TestRegister from "../TestRegister"; + +TestRegister.addTests([ + { + name: "Index of Coincidence", + input: "Hello world, this is a test to determine the correct IC value.", + expectedMatch: /^Index of Coincidence: 0\.07142857142857142\nNormalized: 1\.857142857142857/, + recipeConfig: [ + { + "op": "Index of Coincidence", + "args": [] + }, + ], + }, +]);