From a4873cddb17d24d9a2d10b1aa704cedc021350f9 Mon Sep 17 00:00:00 2001 From: EuAndreh Date: Sun, 13 Jul 2025 19:58:06 -0300 Subject: Add simple test for TRANSITION_FNS * src/paca.mjs (TRANSITION_FNS): Add trailing underscore to ignored arguments, even though it breaks the name of the `_state` and `context` destructuring arguments. * tests/paca.mjs (test_TRANSITION_FNS): Add new test function with a single case for each transition character. Since these transitions are unconditional and contain no logic, this single sample test is enough to cover for all of its behaviour. --- src/paca.mjs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/paca.mjs b/src/paca.mjs index e8ec542..c1bead1 100644 --- a/src/paca.mjs +++ b/src/paca.mjs @@ -107,12 +107,12 @@ const STATE_FNS = { }; const TRANSITION_FNS = { - "\\": ({ out, state, context }, char, index, next) => ({ + "\\": ({ out, _state, context }, _char, _index, _next) => ({ out, state: ConcatStep.ESCAPING, context, }), - "{": ({ out, state, context }, char, index, next) => ({ + "{": ({ out, _state, _context }, _char, _index, _next) => ({ out, state: ConcatStep.RANGE, context: { -- cgit v1.2.3