[git-p4: depot-paths = "//depot/code/antlr4/main/": change = 9229]
This commit is contained in:
parrt 2011-10-30 13:49:35 -08:00
parent 947a11a3e4
commit dd1ad971a9
1 changed files with 13 additions and 0 deletions

View File

@ -127,6 +127,19 @@ public class TestLexerErrors extends BaseTest {
assertEquals(expectingError, error);
}
@Test public void testErrorInMiddle() throws Exception {
String grammar =
"lexer grammar L;\n" +
"A : 'abc' ;\n";
String tokens = execLexer("L.g", grammar, "L", "abx");
String expectingTokens =
"[@0,3:2='<EOF>',<-1>,1:3]\n";
assertEquals(expectingTokens, tokens);
String expectingError = "line 1:0 token recognition error at: 'abx'\n";
String error = stderrDuringParse;
assertEquals(expectingError, error);
}
// TEST RECOVERY
}