mirror of
https://github.com/gchq/CyberChef.git
synced 2025-04-23 00:06:17 -04:00
Merge branch 'defang-ip' of https://github.com/h345983745/CyberChef into h345983745-defang-ip
This commit is contained in:
commit
a4e9025b8e
4 changed files with 110 additions and 1 deletions
|
@ -87,6 +87,7 @@ import "./tests/BLAKE2b";
|
|||
import "./tests/BLAKE2s";
|
||||
import "./tests/Protobuf";
|
||||
import "./tests/ParseSSHHostKey";
|
||||
import "./tests/DefangIP";
|
||||
|
||||
// Cannot test operations that use the File type yet
|
||||
//import "./tests/SplitColourChannels";
|
||||
|
|
43
tests/operations/tests/DefangIP.mjs
Normal file
43
tests/operations/tests/DefangIP.mjs
Normal file
|
@ -0,0 +1,43 @@
|
|||
/**
|
||||
* DefangIP tests.
|
||||
*
|
||||
* @author h345983745
|
||||
*
|
||||
* @copyright Crown Copyright 2019
|
||||
* @license Apache-2.0
|
||||
*/
|
||||
import TestRegister from "../TestRegister";
|
||||
|
||||
TestRegister.addTests([
|
||||
{
|
||||
name: "Defang IP: Valid IPV4",
|
||||
input: "192.168.1.1",
|
||||
expectedOutput: "192[.]168[.]1[.]1",
|
||||
recipeConfig: [
|
||||
{
|
||||
op: "Defang IP",
|
||||
args: [],
|
||||
},
|
||||
],
|
||||
}, {
|
||||
name: "Defang IP: Valid IPV6",
|
||||
input: "2001:0db8:85a3:0000:0000:8a2e:0370:7343",
|
||||
expectedOutput: "2001[:]0db8[:]85a3[:]0000[:]0000[:]8a2e[:]0370[:]7343",
|
||||
recipeConfig: [
|
||||
{
|
||||
op: "Defang IP",
|
||||
args: [],
|
||||
},
|
||||
],
|
||||
}, {
|
||||
name: "Defang IP: Valid IPV6 Shorthand",
|
||||
input: "2001:db8:3c4d:15::1a2f:1a2b",
|
||||
expectedOutput: "2001[:]db8[:]3c4d[:]15[:][:]1a2f[:]1a2b",
|
||||
recipeConfig: [
|
||||
{
|
||||
op: "Defang IP",
|
||||
args: [],
|
||||
},
|
||||
],
|
||||
},
|
||||
]);
|
Loading…
Add table
Add a link
Reference in a new issue