Skip to content

Commit 7cda77f

Browse files
committed
Parser tests
1 parent 21ed735 commit 7cda77f

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

test/tests/parser.js

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,22 @@ export function parserTests() {
2727
];
2828
assert.deepStrictEqual(lexerTest(input), expected);
2929
});
30+
it('should lex single char input', function() {
31+
const input = `A`;
32+
const expected = [
33+
`<Line L1:1> v:'A' t:'A'`,
34+
`<EOF L1:1> v:'' t:''`,
35+
];
36+
assert.deepStrictEqual(lexerTest(input), expected);
37+
});
38+
it('should lex single newline input', function() {
39+
const input = `\n`;
40+
const expected = [
41+
`<EOL L1:1> v:'<EOL>' t:'<EOL>'`,
42+
`<EOF L2:0> v:'' t:''`,
43+
];
44+
assert.deepStrictEqual(lexerTest(input), expected);
45+
});
3046
it('should lex input without terminating newline', function() {
3147
const input = `A`;
3248
const expected = [

0 commit comments

Comments
 (0)