diff --git a/src/core/operations/XOR.mjs b/src/core/operations/XOR.mjs index c093b433..511a7680 100644 --- a/src/core/operations/XOR.mjs +++ b/src/core/operations/XOR.mjs @@ -46,7 +46,7 @@ class XOR extends Operation { { "name": "Filter Key", "type": "boolean", - "value": false + "value": true } ]; } diff --git a/tests/node/tests/operations.mjs b/tests/node/tests/operations.mjs index 4c5d4ada..ea902ace 100644 --- a/tests/node/tests/operations.mjs +++ b/tests/node/tests/operations.mjs @@ -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("abc", {xPath: "contact-info/company"}).toString(),