mirror of
https://github.com/gchq/CyberChef.git
synced 2025-05-08 07:21:02 -04:00
Merge b18dbfff3d
into 9829b419b9
This commit is contained in:
commit
0190984681
4 changed files with 263 additions and 0 deletions
|
@ -80,6 +80,7 @@ import "./tests/PowerSet.mjs";
|
|||
import "./tests/Regex.mjs";
|
||||
import "./tests/Register.mjs";
|
||||
import "./tests/Rotate.mjs";
|
||||
import "./tests/Searcn.mjs";
|
||||
import "./tests/SeqUtils.mjs";
|
||||
import "./tests/SetDifference.mjs";
|
||||
import "./tests/SetIntersection.mjs";
|
||||
|
|
46
tests/operations/tests/Searcn.mjs
Normal file
46
tests/operations/tests/Searcn.mjs
Normal file
|
@ -0,0 +1,46 @@
|
|||
/**
|
||||
* StrUtils tests.
|
||||
*
|
||||
* @author n1474335 [n1474335@gmail.com]
|
||||
* @copyright Crown Copyright 2017
|
||||
* @license Apache-2.0
|
||||
*/
|
||||
import TestRegister from "../../lib/TestRegister.mjs";
|
||||
|
||||
TestRegister.addTests([
|
||||
{
|
||||
name: "Search: HTML op",
|
||||
input: "abc def\ndef abc",
|
||||
expectedOutput: "<span class='hl2' title='Offset: 0\n\
|
||||
Groups:\n\
|
||||
\t1: abc\n\
|
||||
'>abc</span> <span class='hl1' title='Offset: 4\n\
|
||||
Groups:\n\
|
||||
\t1: def\n\
|
||||
'>def</span>\n\
|
||||
<span class='hl2' title='Offset: 8\n\
|
||||
Groups:\n\
|
||||
\t1: def\n\
|
||||
'>def</span> <span class='hl1' title='Offset: 12\n\
|
||||
Groups:\n\
|
||||
\t1: abc\n\
|
||||
'>abc</span>",
|
||||
recipeConfig: [
|
||||
{
|
||||
"op": "Search",
|
||||
"args": ["abc\ndef", false, true, true, false, false, false, "Highlight matches"]
|
||||
}
|
||||
],
|
||||
},
|
||||
{
|
||||
name: "Search: regex",
|
||||
input: "abc def\ndef abc",
|
||||
expectedOutput: "abc\ndef\ndef\nabc",
|
||||
recipeConfig: [
|
||||
{
|
||||
"op": "Search",
|
||||
"args": ["a.c\nd.f", true, true, true, false, false, false, "List matches"]
|
||||
}
|
||||
],
|
||||
}
|
||||
]);
|
Loading…
Add table
Add a link
Reference in a new issue