diff --git a/tool/test/org/antlr/v4/test/TestParseErrors.java b/tool/test/org/antlr/v4/test/TestParseErrors.java index 6549de90b..c5ebf3216 100644 --- a/tool/test/org/antlr/v4/test/TestParseErrors.java +++ b/tool/test/org/antlr/v4/test/TestParseErrors.java @@ -150,6 +150,15 @@ public class TestParseErrors extends BaseTest { assertEquals(expecting, result); } + @Test public void testSingleTokenDeletionDuringLoop() throws Exception { + String grammar = + "grammar T;\n" + + "a : 'a' 'b'* 'c' ;"; + String found = execParser("T.g", grammar, "TParser", "TLexer", "a", "ababbc", false); + String expecting = "line 1:2 extraneous input 'a' expecting {'b', 'c'}\n"; + String result = stderrDuringParse; + assertEquals(expecting, result); + } @Test public void testLL1ErrorInfo() throws Exception { String grammar =