mirror of
https://github.com/gchq/CyberChef
synced 2025-12-27 05:33:23 +00:00
add Set Difference operation
This commit is contained in:
@@ -49,8 +49,7 @@ import "./tests/operations/Base64";
|
||||
// import "./tests/operations/SeqUtils.js";
|
||||
import "./tests/operations/SetUnion";
|
||||
import "./tests/operations/SetIntersection";
|
||||
|
||||
|
||||
import "./tests/operations/SetDifference";
|
||||
|
||||
let allTestsPassing = true;
|
||||
const testStatusCounts = {
|
||||
|
||||
56
test/tests/operations/SetDifference.mjs
Normal file
56
test/tests/operations/SetDifference.mjs
Normal file
@@ -0,0 +1,56 @@
|
||||
/**
|
||||
* 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: ["===", ";"],
|
||||
},
|
||||
],
|
||||
},
|
||||
]);
|
||||
@@ -1,9 +1,9 @@
|
||||
/**
|
||||
* Set Operations tests.
|
||||
* Set Intersection tests.
|
||||
*
|
||||
* @author d98762625
|
||||
*
|
||||
* @copyright Crown Copyright 2017
|
||||
* @copyright Crown Copyright 2018
|
||||
* @license Apache-2.0
|
||||
*/
|
||||
import TestRegister from "../../TestRegister";
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
/**
|
||||
* Set Operations tests.
|
||||
* Set Union tests.
|
||||
*
|
||||
* @author d98762625
|
||||
*
|
||||
* @copyright Crown Copyright 2017
|
||||
* @copyright Crown Copyright 2018
|
||||
* @license Apache-2.0
|
||||
*/
|
||||
import TestRegister from "../../TestRegister";
|
||||
|
||||
Reference in New Issue
Block a user