summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--tests/eval.spec.ts20
-rw-r--r--tests/parser.spec.ts (renamed from tests/basic.spec.ts)0
2 files changed, 20 insertions, 0 deletions
diff --git a/tests/eval.spec.ts b/tests/eval.spec.ts
new file mode 100644
index 0000000..97995bf
--- /dev/null
+++ b/tests/eval.spec.ts
@@ -0,0 +1,20 @@
+import { left, right } from 'fp-ts/Either'
+import { none, some } from 'fp-ts/Option'
+import { Expr, ListExpr } from '../src/types'
+import { jlog } from '../src/utils'
+import { find } from '../src/eval'
+
+describe('Eval', () => {
+ it('should do shit', () => {
+ const liexp: ListExpr = [
+ none,
+ [ Expr.AnyNumber(null), Expr.Truthy(null) ],
+ none,
+ ]
+
+ const list = [0, 1, '2', 3, [4], 5]
+
+ expect(find(liexp, list)).toEqual([1, 3, 5])
+ })
+})
+
diff --git a/tests/basic.spec.ts b/tests/parser.spec.ts
index 150966b..150966b 100644
--- a/tests/basic.spec.ts
+++ b/tests/parser.spec.ts