mirror of
https://github.com/gchq/CyberChef.git
synced 2025-04-25 09:16:17 -04:00
Added tests for Utils.parseEscapedChars
This commit is contained in:
parent
562171ec86
commit
adf9772928
5 changed files with 36 additions and 19 deletions
23
tests/node/tests/Utils.mjs
Normal file
23
tests/node/tests/Utils.mjs
Normal file
|
@ -0,0 +1,23 @@
|
|||
import TestRegister from "../../lib/TestRegister.mjs";
|
||||
import Utils from "../../../src/core/Utils.mjs";
|
||||
import it from "../assertionHandler.mjs";
|
||||
import assert from "assert";
|
||||
|
||||
TestRegister.addApiTests([
|
||||
it("Utils: should parse six backslashes correctly", () => {
|
||||
assert.equal(Utils.parseEscapedChars("\\\\\\\\\\\\"), "\\\\\\");
|
||||
}),
|
||||
|
||||
it("Utils: should parse escaped quotes correctly", () => {
|
||||
assert.equal(Utils.parseEscapedChars("\\'"), "'");
|
||||
}),
|
||||
|
||||
it("Utils: should parse escaped quotes and backslashes correctly", () => {
|
||||
assert.equal(Utils.parseEscapedChars("\\\\'"), "\\'");
|
||||
}),
|
||||
|
||||
it("Utils: should parse escaped quotes and escaped backslashes correctly", () => {
|
||||
assert.equal(Utils.parseEscapedChars("\\\\\\'"), "\\'");
|
||||
}),
|
||||
|
||||
]);
|
Loading…
Add table
Add a link
Reference in a new issue