فهرست منبع

Added Index of Coincidence Tests

George O 6 سال پیش
والد
کامیت
a6732ba815
2فایلهای تغییر یافته به همراه23 افزوده شده و 0 حذف شده
  1. 1 0
      tests/operations/index.mjs
  2. 22 0
      tests/operations/tests/IndexOfCoincidence.mjs

+ 1 - 0
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";

+ 22 - 0
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": []
+            },
+        ],
+    },
+]);