summaryrefslogtreecommitdiff
path: root/tests/sjs.mjs
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--tests/sjs.mjs15
1 files changed, 15 insertions, 0 deletions
diff --git a/tests/sjs.mjs b/tests/sjs.mjs
index dbcd635..c8f52dd 100644
--- a/tests/sjs.mjs
+++ b/tests/sjs.mjs
@@ -1,6 +1,7 @@
import {
max,
min,
+ isNumeric,
explode,
getIn,
merge,
@@ -58,6 +59,19 @@ const test_min = t => {
});
};
+const test_isNumeric = t => {
+ t.start("isNumeric()");
+
+ t.testing("checks if (first) char is numeric", () => {
+ t.assertEq(isNumeric("0"), true);
+ t.assertEq(isNumeric("5"), true);
+ t.assertEq(isNumeric("9"), true);
+ t.assertEq(isNumeric("10"), true);
+ t.assertEq(isNumeric("1a"), true);
+ t.assertEq(isNumeric("a1"), false);
+ });
+};
+
const test_explode = t => {
t.start("explode()");
@@ -976,6 +990,7 @@ const test_repeat = t => {
runTests([
test_max,
test_min,
+ test_isNumeric,
test_explode,
test_getIn,
test_merge,