From 04756dcc2f751e81dac657b13c2b35364bd52e98 Mon Sep 17 00:00:00 2001 From: C85297 <95289555+C85297@users.noreply.github.com> Date: Thu, 2 Jul 2026 10:03:34 +0100 Subject: [PATCH] tests: cover invalid line width validation Addresses review feedback on #2606. --- tests/operations/tests/Wrap.mjs | 44 +++++++++++++++++++++++++++++++++ 1 file changed, 44 insertions(+) diff --git a/tests/operations/tests/Wrap.mjs b/tests/operations/tests/Wrap.mjs index 8d7c9a51..b7569ba8 100644 --- a/tests/operations/tests/Wrap.mjs +++ b/tests/operations/tests/Wrap.mjs @@ -40,5 +40,49 @@ TestRegister.addTests([ "args": [10] }, ], + }, + { + name: "Wrap rejects zero line width", + input: "hello", + expectedOutput: "Line Width must be greater than or equal to 1.", + recipeConfig: [ + { + "op": "Wrap", + "args": [0] + }, + ], + }, + { + name: "Wrap rejects negative line width", + input: "hello", + expectedOutput: "Line Width must be greater than or equal to 1.", + recipeConfig: [ + { + "op": "Wrap", + "args": [-1] + }, + ], + }, + { + name: "Wrap rejects non-integer line width", + input: "hello", + expectedOutput: "Line Width must be an integer.", + recipeConfig: [ + { + "op": "Wrap", + "args": [1.1] + }, + ], + }, + { + name: "Wrap rejects excessive line width", + input: "hello", + expectedOutput: "Line Width must be less than or equal to 65536.", + recipeConfig: [ + { + "op": "Wrap", + "args": [65537] + }, + ], } ]);