summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--tests/paca.mjs17
1 files changed, 17 insertions, 0 deletions
diff --git a/tests/paca.mjs b/tests/paca.mjs
index a4fed28..15e15ec 100644
--- a/tests/paca.mjs
+++ b/tests/paca.mjs
@@ -4,6 +4,7 @@ import {
SyntaxError,
ConcatStep,
numFromDigits,
+ rangeStateStep,
TRANSITION_FNS,
shouldConcat,
isOperator,
@@ -59,6 +60,21 @@ const test_numFromDigits = t => {
});
};
+const test_rangeStateStep = t => {
+ t.start("rangeStateStep()");
+
+ t.testing("error when comma is missing", () => {
+ const { value: { error }} = rangeStateStep(
+ { context: { where: "from" }},
+ "}",
+ null,
+ null,
+ );
+ t.assertEq(error.message, "missing comma in range operator");
+ t.assertEq(error instanceof SyntaxError, true);
+ });
+};
+
const test_TRANSITION_FNS = t => {
t.start("TRANSITION_FNS");
@@ -2402,6 +2418,7 @@ const test_compile = t => {
runTests([
test_numFromDigits,
+ test_rangeStateStep,
test_TRANSITION_FNS,
test_shouldConcat,
test_isOperator,