mirror of
https://github.com/gchq/CyberChef.git
synced 2025-04-23 16:26:16 -04:00
move Set Intersection into its own operation class
This commit is contained in:
parent
5f93c667a2
commit
03ecaa81f7
4 changed files with 116 additions and 11 deletions
56
test/tests/operations/SetIntersection.mjs
Normal file
56
test/tests/operations/SetIntersection.mjs
Normal file
|
@ -0,0 +1,56 @@
|
|||
/**
|
||||
* Set Operations tests.
|
||||
*
|
||||
* @author d98762625
|
||||
*
|
||||
* @copyright Crown Copyright 2017
|
||||
* @license Apache-2.0
|
||||
*/
|
||||
import TestRegister from "../../TestRegister";
|
||||
|
||||
TestRegister.addTests([
|
||||
{
|
||||
name: "Set Intersection",
|
||||
input: "1 2 3 4 5\n\n3 4 5 6 7",
|
||||
expectedOutput: "3 4 5",
|
||||
recipeConfig: [
|
||||
{
|
||||
op: "Set Intersection",
|
||||
args: ["\n\n", " "],
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
name: "Set Intersection: only one set",
|
||||
input: "1 2 3 4 5 6 7 8",
|
||||
expectedOutput: "Incorrect number of sets, perhaps you need to modify the sample delimiter or add more samples?",
|
||||
recipeConfig: [
|
||||
{
|
||||
op: "Set Intersection",
|
||||
args: ["\n\n", " "],
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
name: "Set Intersection: item delimiter",
|
||||
input: "1-2-3-4-5\n\n3-4-5-6-7",
|
||||
expectedOutput: "3-4-5",
|
||||
recipeConfig: [
|
||||
{
|
||||
op: "Set Intersection",
|
||||
args: ["\n\n", "-"],
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
name: "Set Intersection: sample delimiter",
|
||||
input: "1-2-3-4-5z3-4-5-6-7",
|
||||
expectedOutput: "3-4-5",
|
||||
recipeConfig: [
|
||||
{
|
||||
op: "Set Intersection",
|
||||
args: ["z", "-"],
|
||||
},
|
||||
],
|
||||
}
|
||||
]);
|
Loading…
Add table
Add a link
Reference in a new issue