mirror of
https://github.com/gchq/CyberChef.git
synced 2025-04-25 01:06:16 -04:00
Test for ExtractURI
This commit is contained in:
parent
e86bdd960c
commit
e3d6483ab5
3 changed files with 38 additions and 0 deletions
|
@ -64,6 +64,7 @@ import "./tests/ELFInfo.mjs";
|
|||
import "./tests/Enigma.mjs";
|
||||
import "./tests/ExtractEmailAddresses.mjs";
|
||||
import "./tests/ExtractHashes.mjs";
|
||||
import "./tests/ExtractURI.mjs";
|
||||
import "./tests/Float.mjs";
|
||||
import "./tests/FileTree.mjs";
|
||||
import "./tests/FletcherChecksum.mjs";
|
||||
|
|
36
tests/operations/tests/ExtractURI.mjs
Normal file
36
tests/operations/tests/ExtractURI.mjs
Normal file
|
@ -0,0 +1,36 @@
|
|||
/**
|
||||
* Extract URI Tests
|
||||
*
|
||||
* @author David Tomaschik [dwt@google.com]
|
||||
* @copyright Google LLC 2024
|
||||
* @license Apache-2.0
|
||||
*/
|
||||
|
||||
import TestRegister from "../../lib/TestRegister.mjs";
|
||||
|
||||
TestRegister.addTests([
|
||||
{
|
||||
name: "Extract URI: Test",
|
||||
input: "http://www.example.org:9999/path?foo=bar&baz=1&baz=2#frob",
|
||||
expectedOutput: JSON.stringify({
|
||||
"protocol": "http:",
|
||||
"hostname": "www.example.org",
|
||||
"port": "9999",
|
||||
"pathname": "/path",
|
||||
"hash": "#frob",
|
||||
"query": {
|
||||
"foo": "bar",
|
||||
"baz": [
|
||||
"1",
|
||||
"2"
|
||||
]
|
||||
}
|
||||
}, null, 4),
|
||||
recipeConfig: [
|
||||
{
|
||||
"op": "Extract URI",
|
||||
"args": [],
|
||||
}
|
||||
]
|
||||
}
|
||||
]);
|
Loading…
Add table
Add a link
Reference in a new issue