tweak tests

[git-p4: depot-paths = "//depot/code/antlr4/main/": change = 9109]
This commit is contained in:
parrt 2011-10-04 13:28:07 -08:00
parent 6179d7586b
commit c99ce6d26e
1 changed files with 15 additions and 0 deletions

View File

@ -104,4 +104,19 @@ public class TestParseTrees extends BaseTest {
String expecting = "(a <ERROR:z>)\n";
assertEquals(expecting, result);
}
@Test public void testSync() throws Exception {
String grammar =
"grammar T;\n" +
"s\n" +
"@init {setBuildParseTrees(true);}\n" +
"@after {System.out.println($r.toStringTree(this));}\n" +
" : r=a ;\n" +
"a : 'x' 'y'* '!'\n" +
" ;\n" +
"Z : 'z'; \n";
String result = execParser("T.g", grammar, "TParser", "TLexer", "s", "xzyy!", false);
String expecting = "(a x <ERROR:z> y y !)\n";
assertEquals(expecting, result);
}
}