Fix lexer for empty input.

This commit is contained in:
eelke 2019-01-28 20:52:39 +01:00
parent 077fae50af
commit 3b482c1c73
3 changed files with 17 additions and 2 deletions

View file

@ -5,6 +5,19 @@
using namespace testing;
TEST(SqlLexer, emptyInput)
{
QString input;
SqlLexer lexer(input, LexerState::Null);
int startpos, length;
BasicTokenType tokentype;
QString out;
lexer.nextBasicToken(startpos, length, tokentype, out);
ASSERT_THAT(startpos, Eq(0));
ASSERT_THAT(tokentype, Eq(BasicTokenType::End));
}
TEST(SqlLexer, lexer)
{