Test Lexer with empty input

This commit is contained in:
Riccardo Azzolini 2019-08-06 19:42:03 +02:00
parent aeb0388925
commit 86c7da8c81

View File

@ -20,6 +20,15 @@ public class LexerTest {
errors.clear();
}
@Test
public void emptyInput() {
final Lexer lexer = new Lexer("", errors::add);
final List<Token> expected = Collections.singletonList(
new Token(EOF, "", 0)
);
assertEquals(expected, lexer.lex());
}
@Test
public void validRule() {
final Lexer lexer = new Lexer(