From d19a1e4e02c6743f057d03caa9337a5b47bfa9cd Mon Sep 17 00:00:00 2001 From: Akshay Nair Date: Sat, 8 Jan 2022 18:37:57 +0530 Subject: feat(eval): implements basic eval filtering --- tests/eval.spec.ts | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 tests/eval.spec.ts (limited to 'tests/eval.spec.ts') 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]) + }) +}) + -- cgit v1.3.1