mirror of
https://github.com/gchq/CyberChef.git
synced 2025-04-24 16:56:15 -04:00
add other flowcontrol ops. Update tests
This commit is contained in:
parent
046e1ebad9
commit
8ff6596657
15 changed files with 735 additions and 402 deletions
54
test/tests/operations/Jump.mjs
Normal file
54
test/tests/operations/Jump.mjs
Normal file
|
@ -0,0 +1,54 @@
|
|||
/**
|
||||
* Jump tests
|
||||
*
|
||||
* @author tlwr [toby@toby.codes]
|
||||
*
|
||||
* @copyright Crown Copyright 2018
|
||||
* @license Apache-2.0
|
||||
*/
|
||||
import TestRegister from "../../TestRegister";
|
||||
|
||||
TestRegister.addTests([
|
||||
{
|
||||
name: "Jump: Empty Label",
|
||||
input: [
|
||||
"should be changed",
|
||||
].join("\n"),
|
||||
expectedOutput: [
|
||||
"c2hvdWxkIGJlIGNoYW5nZWQ=",
|
||||
].join("\n"),
|
||||
recipeConfig: [
|
||||
{
|
||||
op: "Jump",
|
||||
args: ["", 10],
|
||||
},
|
||||
{
|
||||
op: "To Base64",
|
||||
args: ["A-Za-z0-9+/="],
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
name: "Jump: skips 1",
|
||||
input: [
|
||||
"shouldnt be changed",
|
||||
].join("\n"),
|
||||
expectedOutput: [
|
||||
"shouldnt be changed",
|
||||
].join("\n"),
|
||||
recipeConfig: [
|
||||
{
|
||||
op: "Jump",
|
||||
args: ["skipReplace", 10],
|
||||
},
|
||||
{
|
||||
op: "To Base64",
|
||||
args: ["A-Za-z0-9+/="],
|
||||
},
|
||||
{
|
||||
op: "Label",
|
||||
args: ["skipReplace"]
|
||||
},
|
||||
],
|
||||
}
|
||||
]);
|
Loading…
Add table
Add a link
Reference in a new issue