aboutsummaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorAkshay Nair <phenax5@gmail.com>2022-01-13 14:00:23 +0530
committerAkshay Nair <phenax5@gmail.com>2022-01-13 14:00:23 +0530
commit77b22abdbb9d2b451fe31d97fec2f3a6b9517c33 (patch)
tree1070ad8efabce3c2b136e61fa000a91f9d97aa28 /tests
parent6b170757a811007db77a63952bc4afc0756b257a (diff)
downloadelxr-77b22abdbb9d2b451fe31d97fec2f3a6b9517c33.tar.gz
elxr-77b22abdbb9d2b451fe31d97fec2f3a6b9517c33.zip
refactor: refactors in cps to skip items
Diffstat (limited to '')
-rw-r--r--tests/basic.spec.ts32
1 files changed, 24 insertions, 8 deletions
diff --git a/tests/basic.spec.ts b/tests/basic.spec.ts
index 2817a8f..d57cb05 100644
--- a/tests/basic.spec.ts
+++ b/tests/basic.spec.ts
@@ -1,6 +1,6 @@
import { jlog } from '../src/utils'
import { filter, matchAll } from '../src'
-import {takeLeftWhile} from 'fp-ts/Array'
+import { takeLeftWhile } from 'fp-ts/Array'
describe('Basic tests', () => {
it('should do it', () => {
@@ -16,9 +16,7 @@ describe('Basic tests', () => {
// jlog(matchAll(/[age \n]+/, [ {}, { age: 1 }, { age: 2 }, { age: 0 }, '' ]))
// jlog(matchAll(/[age \n]+/, [ {}, { age: 1 }, '' ]))
// jlog(matchAll(/([age \n])+/, [ {}, { age: 1 }, { age: 2 }, { age: 0 }, '' ]))
-
// jlog(matchAll(/\n+/, [ '', 1, 2, 0, '6', 5, '' ]))
-
// jlog(takeLeftWhile((x: number) => x < 5)([1, 2, 3, 4, 5, 6]))
})
@@ -40,8 +38,13 @@ describe('Basic tests', () => {
it('should match object property matchers', () => {
expect(
- matchAll(/[age \n][age \T]/, [{}, { age: 1 }, { age: 2 }, { age: 0 }, ''])
- .groups,
+ matchAll(/[age \n][age \T]/, [
+ {},
+ { age: 1 },
+ { age: 2 },
+ { age: 0 },
+ '',
+ ]).groups,
).toEqual([
{ value: { age: 1 }, index: 1 },
{ value: { age: 2 }, index: 2 },
@@ -50,14 +53,27 @@ describe('Basic tests', () => {
it('should match object property matchers', () => {
// FIXME: This is invalid match result
+ jlog(
+ matchAll(/([age \n][age \T])+/, [
+ {},
+ { age: 1 },
+ { age: 2 },
+ { age: 0 },
+ '',
+ ]).groups,
+ )
expect(
- matchAll(/([age \n][age \T])+/, [{}, { age: 1 }, { age: 2 }, { age: 0 }, ''])
- .groups,
+ matchAll(/([age \n][age \T])+/, [
+ {},
+ { age: 1 },
+ { age: 2 },
+ { age: 0 },
+ '',
+ ]).groups,
).toEqual([
{ value: [{ age: 1 }, { age: 2 }], index: 1 },
{ value: [{ age: 2 }], index: 2 },
])
})
-
})
})