Test Lexer with empty input
This commit is contained in:
parent
aeb0388925
commit
86c7da8c81
@ -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(
|
||||
|
Loading…
Reference in New Issue
Block a user