We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 1a358e1 commit 2bdfe08Copy full SHA for 2bdfe08
tests/lexer/lexer.test.ts
@@ -1,3 +1,5 @@
1
+/* eslint-disable max-nested-callbacks */
2
+
3
/* Imports */
4
import { Lexer } from "../../src/lexer/lexer.js";
5
import { Token, TokenEnum } from "../../src/lexer/token";
@@ -178,6 +180,11 @@ describe("Lexer", () => {
178
180
new Token(TokenEnum.STRING, "hello\rworld"),
179
181
]);
182
});
183
184
+ it("should error on invalid escape sequence", () => {
185
+ const lexer = new Lexer('"hello\\xworld"');
186
+ expect(() => lexer.lex()).toThrow("Invalid escape sequence: \\x");
187
+ });
188
189
190
describe("should handle numeric escape sequences", () => {
0 commit comments