mirror of
https://github.com/gchq/CyberChef.git
synced 2025-06-14 10:14:53 -04:00
fix: revert previous commit wrong file staged, added file with new test for error feature
This commit is contained in:
parent
8589e06e78
commit
b824268525
2 changed files with 14 additions and 1 deletions
|
@ -46,7 +46,7 @@ class XOR extends Operation {
|
|||
{
|
||||
"name": "Filter Key",
|
||||
"type": "boolean",
|
||||
"value": false
|
||||
"value": true
|
||||
}
|
||||
];
|
||||
}
|
||||
|
|
|
@ -974,6 +974,19 @@ smothering ampersand abreast`;
|
|||
"QV\u0010\u0004UDWQ");
|
||||
}),
|
||||
|
||||
it("XOR: should throw 'Invalid Characters in key' error when key contains invalid characters", () => {
|
||||
const invalidKeys = [
|
||||
{ string: "zz 00 11", option: "Hex" },
|
||||
|
||||
{ string: "4~ 00 11", option: "Hex" }
|
||||
];
|
||||
invalidKeys.forEach(invalidKey => {
|
||||
assert.throws(() => {
|
||||
chef.XOR("fe023da5", { key: invalidKey });
|
||||
}, /Invalid Characters in key/);
|
||||
});
|
||||
}),
|
||||
|
||||
it("XPath expression", () => {
|
||||
assert.strictEqual(
|
||||
chef.XPathExpression("<contact-info><company>abc</company></contact-info>", {xPath: "contact-info/company"}).toString(),
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue