From 6b6ae83c81e79b09eca2c2cc463deae3e64e08da Mon Sep 17 00:00:00 2001 From: John L Date: Mon, 20 Dec 2021 10:12:56 +0000 Subject: [PATCH] Better test coverage --- src/core/operations/EscapeSmartCharacters.mjs | 2 +- .../tests/EscapeSmartCharacters.mjs | 23 ++++++++++++++++++- 2 files changed, 23 insertions(+), 2 deletions(-) diff --git a/src/core/operations/EscapeSmartCharacters.mjs b/src/core/operations/EscapeSmartCharacters.mjs index 5b5ced5e..72a4c5fe 100644 --- a/src/core/operations/EscapeSmartCharacters.mjs +++ b/src/core/operations/EscapeSmartCharacters.mjs @@ -29,7 +29,7 @@ class EscapeSmartCharacters extends Operation { this.args = [ /* Arguments. See the project wiki for full details.*/ { - name: "Second arg", + name: "Output action", type: "option", value: ["Escape", "Remove", "Replace with '.'"] } diff --git a/tests/operations/tests/EscapeSmartCharacters.mjs b/tests/operations/tests/EscapeSmartCharacters.mjs index aeee315b..45374f42 100644 --- a/tests/operations/tests/EscapeSmartCharacters.mjs +++ b/tests/operations/tests/EscapeSmartCharacters.mjs @@ -18,5 +18,26 @@ }, ], }, + { + name: "Escape Smart Characters - Remove", + input: "“”—‘’ →©…", + expectedOutput: " ", + recipeConfig: [ + { + op: "Escape Smart Characters", + args: ["Remove"], + }, + ], + }, + { + name: "Escape Smart Characters - Replace", + input: "“”—‘’ →©…", + expectedOutput: "..... ...", + recipeConfig: [ + { + op: "Escape Smart Characters", + args: ["Replace with '.'"], + }, + ], + }, ]); -g \ No newline at end of file