cyberchef/tests/operations/tests/Arithmetic.mjs
GCHQDeveloper581 275b594f7c
Fix BigNumber deserialisation in Dish, and add tests (#2607)
With ideas from: cyphercodes <cyphercodes@users.noreply.github.com>
With ideas from: Sivachandran Paramasivam <sivachandran.p@gmail.com>
2026-06-26 12:07:33 +00:00

34 lines
666 B
JavaScript

/**
* Tests for arithmetical operations
*
* @copyright Crown Copyright 2026
* @license Apache-2.0
*/
import TestRegister from "../../lib/TestRegister.mjs";
TestRegister.addTests([
{
name: "Subtract",
input: "321,123,test",
expectedOutput: "198",
recipeConfig: [
{
"op": "Subtract",
"args": ["Comma"]
},
],
},
{
name: "Subtract - no valid input",
input: "test",
expectedOutput: "NaN",
recipeConfig: [
{
"op": "Subtract",
"args": ["Comma"]
},
],
},
]);