From b750006cf0bef9b8609d30ffb445281150b0837a Mon Sep 17 00:00:00 2001 From: Spencer Walden Date: Sun, 30 Dec 2018 03:21:19 -0800 Subject: [PATCH] Adds tests for 'To/From Case Insensitive Regex' operations --- .../operations/ToFromInsensitiveRegex.mjs | 56 +++++++++++++++++++ 1 file changed, 56 insertions(+) create mode 100644 test/tests/operations/ToFromInsensitiveRegex.mjs diff --git a/test/tests/operations/ToFromInsensitiveRegex.mjs b/test/tests/operations/ToFromInsensitiveRegex.mjs new file mode 100644 index 00000000..13c24e44 --- /dev/null +++ b/test/tests/operations/ToFromInsensitiveRegex.mjs @@ -0,0 +1,56 @@ +/** + * To/From Case Insensitive Regex tests. + * + * @author masq [github.cyberchef@masq.cc] + * + * @copyright Crown Copyright 2018 + * @license Apache-2.0 + */ +import TestRegister from "../../TestRegister"; + +TestRegister.addTests([ + { + name: "To Case Insensitive Regex: nothing", + input: "", + expectedOutput: "", + recipeConfig: [ + { + op: "To Case Insensitive Regex", + args: [], + }, + ], + }, + { + name: "From Case Insensitive Regex: nothing", + input: "", + expectedOutput: "", + recipeConfig: [ + { + op: "From Case Insensitive Regex", + args: [], + }, + ], + }, + { + name: "To Case Insensitive Regex: simple test", + input: "S0meth!ng", + expectedOutput: "[sS]0[mM][eE][tT][hH]![nN][gG]", + recipeConfig: [ + { + op: "To Case Insensitive Regex", + args: [], + }, + ], + }, + { + name: "From Case Insensitive Regex: simple test", + input: "[sS]0[mM][eE][tT][hH]![nN][Gg] [wr][On][g]?", + expectedOutput: "s0meth!nG [wr][On][g]?", + recipeConfig: [ + { + op: "From Case Insensitive Regex", + args: [], + }, + ], + }, +]);