1
0
mirror of synced 2024-12-15 16:31:14 +01:00
CyberChef/test/tests/operations/SetUnion.mjs

68 lines
1.6 KiB
JavaScript
Raw Normal View History

2018-04-06 17:27:24 +02:00
/**
2018-04-09 11:23:05 +02:00
* Set Union tests.
2018-04-06 17:27:24 +02:00
*
* @author d98762625
*
2018-04-09 11:23:05 +02:00
* @copyright Crown Copyright 2018
2018-04-06 17:27:24 +02:00
* @license Apache-2.0
*/
import TestRegister from "../../TestRegister";
TestRegister.addTests([
{
name: "Set Union: Nothing",
input: "\n\n",
expectedOutput: "",
recipeConfig: [
{
op: "Set Union",
args: ["\n\n", " "],
},
],
},
{
name: "Set Union",
input: "1 2 3 4 5\n\n3 4 5 6 7",
expectedOutput: "1 2 3 4 5 6 7",
recipeConfig: [
{
op: "Set Union",
args: ["\n\n", " "],
},
],
},
{
name: "Set Union: invalid sample number",
input: "1 2 3 4 5\n\n3 4 5 6 7\n\n1",
expectedOutput: "Incorrect number of sets, perhaps you need to modify the sample delimiter or add more samples?",
recipeConfig: [
{
op: "Set Union",
args: ["\n\n", " "],
},
],
},
{
name: "Set Union: item delimiter",
input: "1,2,3,4,5\n\n3,4,5,6,7",
expectedOutput: "1,2,3,4,5,6,7",
recipeConfig: [
{
op: "Set Union",
args: ["\n\n", ","],
},
],
},
{
name: "Set Union: sample delimiter",
input: "1 2 3 4 5whatever3 4 5 6 7",
expectedOutput: "1 2 3 4 5 6 7",
recipeConfig: [
{
op: "Set Union",
args: ["whatever", " "],
},
],
},
]);