diff options
Diffstat (limited to 'tests')
| -rw-r--r-- | tests/parser.spec.ts | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/tests/parser.spec.ts b/tests/parser.spec.ts index 0506be0..6033040 100644 --- a/tests/parser.spec.ts +++ b/tests/parser.spec.ts @@ -6,7 +6,7 @@ import { delimited, not, symbol, - satifyChar, + satisfyChar, matchChar, manyTill, pair, @@ -146,6 +146,14 @@ describe('Parser', () => { expect(parser(/ false /.source)).toEqual( wrap(Expr.Literal(Literal.Boolean(false))), ) + + // String literal + expect(parser(/ "foobar" /.source)).toEqual( + wrap(Expr.Literal(Literal.String('foobar'))), + ) + expect(parser(/ "\nwowksadj\n\t wjksdlsd'' !@#%^(&^%$) " /.source)).toEqual( + wrap(Expr.Literal(Literal.String('\\nwowksadj\\n\\t wjksdlsd\'\' !@#%^(&^%$) '))), + ) }) it('sequence of values', () => { |
