summaryrefslogtreecommitdiff
path: root/tests/paca.mjs
diff options
context:
space:
mode:
Diffstat (limited to 'tests/paca.mjs')
-rw-r--r--tests/paca.mjs34
1 files changed, 17 insertions, 17 deletions
diff --git a/tests/paca.mjs b/tests/paca.mjs
index a7cd929..a4fed28 100644
--- a/tests/paca.mjs
+++ b/tests/paca.mjs
@@ -3,10 +3,10 @@ import { explode, reduced, reductions, runTests } from "sjs";
import {
SyntaxError,
ConcatStep,
+ numFromDigits,
TRANSITION_FNS,
shouldConcat,
isOperator,
- numFromDigits,
tokenizeRegexStep,
tokenizeRegexFn,
tokenizeRegex,
@@ -44,6 +44,21 @@ import {
+const test_numFromDigits = t => {
+ t.start("numFromDigits()");
+
+ t.testing("-1 on empty array", () => {
+ t.assertEq(numFromDigits([]), -1);
+ });
+
+ t.testing("the number from the digits", () => {
+ t.assertEq(numFromDigits([ "0" ]), 0);
+ t.assertEq(numFromDigits([ "1" ]), 1);
+ t.assertEq(numFromDigits([ "0", "1" ]), 1);
+ t.assertEq(numFromDigits([ "1", "2", "3" ]), 123);
+ });
+};
+
const test_TRANSITION_FNS = t => {
t.start("TRANSITION_FNS");
@@ -140,21 +155,6 @@ const test_isOperator = t => {
});
};
-const test_numFromDigits = t => {
- t.start("numFromDigits()");
-
- t.testing("-1 on empty array", () => {
- t.assertEq(numFromDigits([]), -1);
- });
-
- t.testing("the number from the digits", () => {
- t.assertEq(numFromDigits([ "0" ]), 0);
- t.assertEq(numFromDigits([ "1" ]), 1);
- t.assertEq(numFromDigits([ "0", "1" ]), 1);
- t.assertEq(numFromDigits([ "1", "2", "3" ]), 123);
- });
-};
-
const test_tokenizeRegexStep = t => {
t.start("tokenizeRegexStep()");
@@ -2401,10 +2401,10 @@ const test_compile = t => {
runTests([
+ test_numFromDigits,
test_TRANSITION_FNS,
test_shouldConcat,
test_isOperator,
- test_numFromDigits,
test_tokenizeRegexStep,
test_tokenizeRegexFn,
test_tokenizeRegex,