From a0d732c62e9ff1a69bddca18a6c8a134b8288f0a Mon Sep 17 00:00:00 2001 From: Alice Date: Tue, 6 Feb 2024 13:03:15 -0500 Subject: [PATCH] Add MurmurHash3 Tests and normalize filename --- tests/operations/index.mjs | 1 + tests/operations/tests/MurmurHash3.mjs | 55 ++++++++++++++++++++++++++ 2 files changed, 56 insertions(+) create mode 100644 tests/operations/tests/MurmurHash3.mjs diff --git a/tests/operations/index.mjs b/tests/operations/index.mjs index 570fbb6fe..3af185068 100644 --- a/tests/operations/index.mjs +++ b/tests/operations/index.mjs @@ -65,6 +65,7 @@ import "./tests/JWTVerify.mjs"; import "./tests/MS.mjs"; import "./tests/Magic.mjs"; import "./tests/MorseCode.mjs"; +import "./tests/MurmurHash3.mjs"; import "./tests/NetBIOS.mjs"; import "./tests/NormaliseUnicode.mjs"; import "./tests/OTP.mjs"; diff --git a/tests/operations/tests/MurmurHash3.mjs b/tests/operations/tests/MurmurHash3.mjs new file mode 100644 index 000000000..d6490c7b5 --- /dev/null +++ b/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], + }, + ], + } +]);