diff options
| author | Akshay Nair <phenax5@gmail.com> | 2022-01-13 14:49:05 +0530 |
|---|---|---|
| committer | Akshay Nair <phenax5@gmail.com> | 2022-01-13 14:49:05 +0530 |
| commit | 6b9a3d2ee4ec49f38f02106e3aa264946b7cdc93 (patch) | |
| tree | b884da940ff47683064e1723655ed46b8ab7f85d /tests/parser.spec.ts | |
| parent | 6362218062a7b41e4aefe902ba5aed11aaa540c5 (diff) | |
| download | elxr-6b9a3d2ee4ec49f38f02106e3aa264946b7cdc93.tar.gz elxr-6b9a3d2ee4ec49f38f02106e3aa264946b7cdc93.zip | |
refactor: type + constructors refactor
Diffstat (limited to 'tests/parser.spec.ts')
| -rw-r--r-- | tests/parser.spec.ts | 36 |
1 files changed, 18 insertions, 18 deletions
diff --git a/tests/parser.spec.ts b/tests/parser.spec.ts index 4db0894..9bc891e 100644 --- a/tests/parser.spec.ts +++ b/tests/parser.spec.ts @@ -33,15 +33,15 @@ describe('Foobar', () => { expect(parser(/^ .\s(\n)\b \T $/.source)).toEqual( right([ [ - some(Expr.Start(null)), + some(Expr.Start()), [ - Expr.AnyItem(null), - Expr.AnyString(null), - Expr.Group({ exprs: [Expr.AnyNumber(null)] }), - Expr.AnyBool(null), - Expr.Truthy(null), + Expr.AnyItem(), + Expr.AnyString(), + Expr.Group({ exprs: [Expr.AnyNumber()] }), + Expr.AnyBool(), + Expr.Truthy(), ], - some(Expr.End(null)), + some(Expr.End()), ], '', ]), @@ -50,13 +50,13 @@ describe('Foobar', () => { expect(parser(/^ \s* \T? \n+ $/.source)).toEqual( right([ [ - some(Expr.Start(null)), + some(Expr.Start()), [ - Expr.ZeroOrMore({ expr: Expr.AnyString(null) }), - Expr.Optional({ expr: Expr.Truthy(null) }), - Expr.OneOrMore({ expr: Expr.AnyNumber(null) }), + Expr.ZeroOrMore({ expr: Expr.AnyString() }), + Expr.Optional({ expr: Expr.Truthy() }), + Expr.OneOrMore({ expr: Expr.AnyNumber() }), ], - some(Expr.End(null)), + some(Expr.End()), ], '', ]), @@ -68,12 +68,12 @@ describe('Foobar', () => { none, [ Expr.Or({ - left: Expr.AnyString(null), + left: Expr.AnyString(), right: [ - Expr.AnyBool(null), + Expr.AnyBool(), Expr.Or({ - left: Expr.Truthy(null), - right: [Expr.AnyNumber(null)], + left: Expr.Truthy(), + right: [Expr.AnyNumber()], }), ], }), @@ -93,9 +93,9 @@ describe('Foobar', () => { [ Expr.PropertyMatch({ name: 'name', - exprs: [Expr.AnyString(null), Expr.Truthy(null)], + exprs: [Expr.AnyString(), Expr.Truthy()], }), - Expr.PropertyMatch({ name: 'age', exprs: [Expr.AnyNumber(null)] }), + Expr.PropertyMatch({ name: 'age', exprs: [Expr.AnyNumber()] }), ], none, ], |
