aboutsummaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--tests/parser.spec.ts20
1 files changed, 19 insertions, 1 deletions
diff --git a/tests/parser.spec.ts b/tests/parser.spec.ts
index 150966b..1ebd290 100644
--- a/tests/parser.spec.ts
+++ b/tests/parser.spec.ts
@@ -4,8 +4,10 @@ import {
whitespace,
whitespaces0,
delimited,
+ many1,
+ satifyChar,
} from '../src/parser/utils'
-import { parser } from '../src/parser'
+import { parser, propertyName } from '../src/parser'
import { none, some } from 'fp-ts/Option'
import { Expr } from '../src/types'
@@ -82,4 +84,20 @@ describe('Foobar', () => {
]),
)
})
+
+ it('object proprtyu', () => {
+ expect(parser(/ [name \s\T] [age \n] /.source)).toEqual(
+ right([
+ [
+ none,
+ [
+ Expr.PropertyMatch({ name: 'name', exprs: [Expr.AnyString(null), Expr.Truthy(null)] }),
+ Expr.PropertyMatch({ name: 'age', exprs: [Expr.AnyNumber(null)] }),
+ ],
+ none,
+ ],
+ '',
+ ]),
+ )
+ })
})