mirror of
https://github.com/gchq/CyberChef.git
synced 2024-09-07 12:11:35 +02:00
57 lines
1.3 KiB
JavaScript
57 lines
1.3 KiB
JavaScript
|
/**
|
||
|
* Set Difference tests.
|
||
|
*
|
||
|
* @author d98762625
|
||
|
*
|
||
|
* @copyright Crown Copyright 2018
|
||
|
* @license Apache-2.0
|
||
|
*/
|
||
|
import TestRegister from "../../TestRegister";
|
||
|
|
||
|
TestRegister.addTests([
|
||
|
{
|
||
|
name: "Set Difference",
|
||
|
input: "1 2 3 4 5\n\n3 4 5 6 7",
|
||
|
expectedOutput: "1 2",
|
||
|
recipeConfig: [
|
||
|
{
|
||
|
op: "Set Difference",
|
||
|
args: ["\n\n", " "],
|
||
|
},
|
||
|
],
|
||
|
},
|
||
|
{
|
||
|
name: "Set Difference: wrong sample count",
|
||
|
input: "1 2 3 4 5_3_4 5 6 7",
|
||
|
expectedOutput: "Incorrect number of sets, perhaps you need to modify the sample delimiter or add more samples?",
|
||
|
recipeConfig: [
|
||
|
{
|
||
|
op: "Set Difference",
|
||
|
args: [" ", "_"],
|
||
|
},
|
||
|
],
|
||
|
},
|
||
|
{
|
||
|
name: "Set Difference: item delimiter",
|
||
|
input: "1;2;3;4;5\n\n3;4;5;6;7",
|
||
|
expectedOutput: "1;2",
|
||
|
recipeConfig: [
|
||
|
{
|
||
|
op: "Set Difference",
|
||
|
args: ["\n\n", ";"],
|
||
|
},
|
||
|
],
|
||
|
},
|
||
|
{
|
||
|
name: "Set Difference: sample delimiter",
|
||
|
input: "1;2;3;4;5===3;4;5;6;7",
|
||
|
expectedOutput: "1;2",
|
||
|
recipeConfig: [
|
||
|
{
|
||
|
op: "Set Difference",
|
||
|
args: ["===", ";"],
|
||
|
},
|
||
|
],
|
||
|
},
|
||
|
]);
|