mirror of
https://github.com/gchq/CyberChef.git
synced 2025-04-26 01:36:17 -04:00
Added initial tests & counts support
This commit is contained in:
parent
8bba4b2973
commit
0602f457ce
3 changed files with 35 additions and 3 deletions
|
@ -82,6 +82,7 @@ import "./tests/TranslateDateTimeFormat";
|
|||
import "./tests/Magic";
|
||||
import "./tests/ParseTLV";
|
||||
import "./tests/Media";
|
||||
import "./tests/YARA.mjs";
|
||||
|
||||
// Cannot test operations that use the File type yet
|
||||
//import "./tests/SplitColourChannels";
|
||||
|
|
24
tests/operations/tests/YARA.mjs
Normal file
24
tests/operations/tests/YARA.mjs
Normal file
|
@ -0,0 +1,24 @@
|
|||
/**
|
||||
* YARA Rules tests.
|
||||
*
|
||||
* @author Matt C [matt@artemisbot.uk]
|
||||
*
|
||||
* @copyright Crown Copyright 2019
|
||||
* @license Apache-2.0
|
||||
*/
|
||||
import TestRegister from "../TestRegister";
|
||||
|
||||
TestRegister.addTests([
|
||||
{
|
||||
name: "YARA Match: simple foobar",
|
||||
input: "foobar foobar bar foo foobar",
|
||||
expectedOutput: "Rule \"foo\" matches (4 times):\nPos 0, length 3, identifier $re1, data: \"foo\"\nPos 7, length 3, identifier $re1, data: \"foo\"\nPos 18, length 3, identifier $re1, data: \"foo\"\nPos 22, length 3, identifier $re1, data: \"foo\"\nRule \"bar\" matches (4 times):\nPos 3, length 3, identifier $re1, data: \"bar\"\nPos 10, length 3, identifier $re1, data: \"bar\"\nPos 14, length 3, identifier $re1, data: \"bar\"\nPos 25, length 3, identifier $re1, data: \"bar\"\n",
|
||||
recipeConfig: [
|
||||
{
|
||||
"op": "YARA Rules",
|
||||
"args": ["rule foo {strings: $re1 = /foo/ condition: $re1} rule bar {strings: $re1 = /bar/ condition: $re1}", true, true, true, true],
|
||||
}
|
||||
],
|
||||
},
|
||||
]);
|
||||
|
Loading…
Add table
Add a link
Reference in a new issue