From aae935d3ea5c5f3c7cc41eba6732e6d23703a332 Mon Sep 17 00:00:00 2001 From: GCHQDeveloper581 <63102987+GCHQDeveloper581@users.noreply.github.com> Date: Wed, 4 Mar 2026 10:34:33 +0000 Subject: [PATCH] Add a failing test for "javascript escaped" ansi escape codes --- .../tests/RemoveANSIEscapeCodes.mjs | 24 ++++++++++++++++++- 1 file changed, 23 insertions(+), 1 deletion(-) diff --git a/tests/operations/tests/RemoveANSIEscapeCodes.mjs b/tests/operations/tests/RemoveANSIEscapeCodes.mjs index a3abe14a2..e37747313 100644 --- a/tests/operations/tests/RemoveANSIEscapeCodes.mjs +++ b/tests/operations/tests/RemoveANSIEscapeCodes.mjs @@ -41,5 +41,27 @@ TestRegister.addTests([ ], }, ], - } + }, + + { + "name": "Remove ANSI Escape Codes: text containing javascript escape representation of ansi escape codes", + // input/output expressed in hex to avoid accidental interpretation of Javascript escapes and to make the test case explicit + "input": "5c 30 33 33 5b 33 32 3b 31 3b 33 3b 34 3b 39 6d 48 65 6c 6c 6f 2c 20 5c 30 33 33 5b 33 32 3b 31 3b 33 3b 34 3b 39 6d 57 6f 72 6c 64 21", + "expectedOutput": "5c 30 33 33 5b 33 32 3b 31 3b 33 3b 34 3b 39 6d 48 65 6c 6c 6f 2c 20 5c 30 33 33 5b 33 32 3b 31 3b 33 3b 34 3b 39 6d 57 6f 72 6c 64 21", + "recipeConfig": [ + { + "op": "From Hex", + "args": ["Auto"] + }, + { + "op": "Remove ANSI Escape Codes", + "args": [] + }, + { + "op": "To Hex", + "args": ["Space", 0] + } + ], + }, + ]);