We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent d09e1ae commit 4ff723dCopy full SHA for 4ff723d
1 file changed
test/unit/es6/Lexer.js
@@ -58,5 +58,22 @@ test('template lexer', {
58
assert.equal(tokens('SELECT `"', '`'), '`,_');
59
assert.equal(tokens('SELECT ```', '`'), '`,_');
60
assert.equal(tokens('SELECT `\\`', '`'), '`,_');
61
+ },
62
+ 'replay error': function () {
63
+ const lexer = Lexer.makeLexer();
64
+ assert.equal(lexer('SELECT '), null);
65
+ assert.throws(
66
+ () => lexer(' # '),
67
+ /^Error: Expected delimiter at " # "$/);
68
+ // Providing more input throws the same error.
69
70
+ () => lexer(' '),
71
72
73
+ 'unfinished escape squence': function () {
74
75
76
+ () => lexer('SELECT "\\'),
77
+ /^Error: Expected "\\\\" at "\\\\"$/);
78
}
79
});
0 commit comments