diff options
| author | Akshay Nair <phenax5@gmail.com> | 2022-01-13 23:05:21 +0530 |
|---|---|---|
| committer | Akshay Nair <phenax5@gmail.com> | 2022-01-13 23:05:21 +0530 |
| commit | d10c241332cf14a0b9171739a76cbdafdbdf2826 (patch) | |
| tree | 280c38b4fa792e4556188458bd2b43f2a2e5aa46 /tests | |
| parent | 11bb9b17ad84e0c07aaa50ce65411a8adf692685 (diff) | |
| download | elxr-d10c241332cf14a0b9171739a76cbdafdbdf2826.tar.gz elxr-d10c241332cf14a0b9171739a76cbdafdbdf2826.zip | |
feat(eval): implements sequence
Diffstat (limited to '')
| -rw-r--r-- | tests/basic.spec.ts | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/tests/basic.spec.ts b/tests/basic.spec.ts index 3c49267..482428a 100644 --- a/tests/basic.spec.ts +++ b/tests/basic.spec.ts @@ -120,5 +120,15 @@ describe('Basic tests', () => { { value: [{ v: 1 }], index: 10 }, ]) }) + + it('should match sequence of matchers', () => { + expect( + matchAll(/ true, \n, \s /, [true, 5, 'five', 1, 2, 3, true, 7, 'seven']) + .groups, + ).toEqual([ + { value: [ [{ value: true, index: 0 }], [{ value: 5, index: 1 }], [{ value: 'five', index: 2 }] ], index: 0 }, + { value: [ [{ value: true, index: 6 }], [{ value: 7, index: 7 }], [{ value: 'seven', index: 8 }] ], index: 6 }, + ]) + }) }) }) |
