From 64c19d760de6d9e0b6845d1c3af0e9fda845b960 Mon Sep 17 00:00:00 2001 From: martin dobrev Date: Tue, 20 Oct 2020 18:52:20 +0300 Subject: Now lexer returns error when meet invalid token. --- JSImpl/test/LexerTests.cpp | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'JSImpl/test/LexerTests.cpp') diff --git a/JSImpl/test/LexerTests.cpp b/JSImpl/test/LexerTests.cpp index a1a25d3..965730e 100644 --- a/JSImpl/test/LexerTests.cpp +++ b/JSImpl/test/LexerTests.cpp @@ -212,3 +212,10 @@ TEST(Lexer, CommentError) res.Error.Column == 3); } +TEST(Lexer, UnexpectedToken) +{ + auto res = Tokenize("a#4"); + ASSERT_TRUE(!res.IsSuccessful && + res.Error.Column == 1); +} + -- cgit v1.3.1-23-gd82d