forked from jasder/antlr
more
[git-p4: depot-paths = "//depot/code/antlr4/main/": change = 9229]
This commit is contained in:
parent
947a11a3e4
commit
dd1ad971a9
|
@ -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
|
||||
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue