Browse Source

Add MurmurHash3 Tests and normalize filename

Alice 1 year ago
parent
commit
59b97bfccb
2 changed files with 56 additions and 0 deletions
  1. 1 0
      tests/operations/index.mjs
  2. 55 0
      tests/operations/tests/MurmurHash3.mjs

+ 1 - 0
tests/operations/index.mjs

@@ -66,6 +66,7 @@ import "./tests/LZNT1Decompress.mjs";
 import "./tests/MS.mjs";
 import "./tests/MS.mjs";
 import "./tests/Magic.mjs";
 import "./tests/Magic.mjs";
 import "./tests/MorseCode.mjs";
 import "./tests/MorseCode.mjs";
+import "./tests/MurmurHash3.mjs";
 import "./tests/NetBIOS.mjs";
 import "./tests/NetBIOS.mjs";
 import "./tests/NormaliseUnicode.mjs";
 import "./tests/NormaliseUnicode.mjs";
 import "./tests/OTP.mjs";
 import "./tests/OTP.mjs";

+ 55 - 0
tests/operations/tests/MurmurHash3.mjs

@@ -0,0 +1,55 @@
+/**
+ * MurmurHash3 tests
+ * @author AliceGrey [alice@grey.systems]
+ * @copyright Crown Copyright 2024
+ * @license Apache-2.0
+ */
+
+import TestRegister from "../../lib/TestRegister.mjs";
+
+TestRegister.addTests([
+    {
+        name: "To MurmurHash3: nothing",
+        input: "",
+        expectedOutput: "0",
+        recipeConfig: [
+            {
+                op: "MurmurHash3",
+                args: [0],
+            },
+        ],
+    },
+    {
+        name: "To MurmurHash3: 1",
+        input: "1",
+        expectedOutput: "2484513939",
+        recipeConfig: [
+            {
+                op: "MurmurHash3",
+                args: [0],
+            },
+        ],
+    },
+    {
+        name: "To MurmurHash3: Hello World!",
+        input: "Hello World!",
+        expectedOutput: "3691591037",
+        recipeConfig: [
+            {
+                op: "MurmurHash3",
+                args: [0],
+            },
+        ],
+    },
+    {
+        name: "To MurmurHash3: Hello World! with seed",
+        input: "Hello World!",
+        expectedOutput: "1148600031",
+        recipeConfig: [
+            {
+                op: "MurmurHash3",
+                args: [1337],
+            },
+        ],
+    }
+]);