mirror of
https://github.com/gchq/CyberChef.git
synced 2025-05-12 01:01:32 -04:00
Adding basic arithmetic operation
This commit is contained in:
parent
ae1b12c120
commit
f9cbb6246b
6 changed files with 157 additions and 1 deletions
|
@ -107,6 +107,7 @@ import "./tests/CBORDecode.mjs";
|
|||
import "./tests/JA3Fingerprint.mjs";
|
||||
import "./tests/JA3SFingerprint.mjs";
|
||||
import "./tests/HASSH.mjs";
|
||||
import "./tests/AddSubMulDivValue.mjs";
|
||||
|
||||
|
||||
// Cannot test operations that use the File type yet
|
||||
|
|
50
tests/operations/tests/AddSubMulDivValue.mjs
Normal file
50
tests/operations/tests/AddSubMulDivValue.mjs
Normal file
|
@ -0,0 +1,50 @@
|
|||
/**
|
||||
* BitwiseOp tests
|
||||
*
|
||||
* @author BigYellowHammer
|
||||
* @license Apache-2.0
|
||||
*/
|
||||
import TestRegister from "../../lib/TestRegister.mjs";
|
||||
|
||||
TestRegister.addTests([
|
||||
{
|
||||
name: "Add value",
|
||||
input: "9",
|
||||
expectedOutput: "11",
|
||||
recipeConfig: [
|
||||
{ "op": "Add/Subtract/Multiply/Divide by value",
|
||||
"args": ["Add", "2"] },
|
||||
|
||||
]
|
||||
},
|
||||
{
|
||||
name: "Subtract value",
|
||||
input: "9",
|
||||
expectedOutput: "7",
|
||||
recipeConfig: [
|
||||
{ "op": "Add/Subtract/Multiply/Divide by value",
|
||||
"args": ["Subtract", "2"] },
|
||||
|
||||
]
|
||||
},
|
||||
{
|
||||
name: "Multiply by value",
|
||||
input: "9",
|
||||
expectedOutput: "18",
|
||||
recipeConfig: [
|
||||
{ "op": "Add/Subtract/Multiply/Divide by value",
|
||||
"args": ["Multiply", "2"] },
|
||||
|
||||
]
|
||||
},
|
||||
{
|
||||
name: "Multiply by value",
|
||||
input: "10",
|
||||
expectedOutput: "5",
|
||||
recipeConfig: [
|
||||
{ "op": "Add/Subtract/Multiply/Divide by value",
|
||||
"args": ["Divide", "2"] },
|
||||
|
||||
]
|
||||
}
|
||||
]);
|
Loading…
Add table
Add a link
Reference in a new issue