String found = g.getRule("a").tree.toStringTree();
assertEquals(expecting, found);
}
@Test public void testRootTokenInStarLoop() throws Exception {
Grammar g = new Grammar(
"grammar Expr;\n" +
"options { output=AST; backtrack=true; }\n" +
"a : ('*'^)* ;\n"); // bug: the synpred had nothing in it
String expecting =
"(rule synpred1_Expr ARG RET scope (BLOCK (ALT '*' <end-of-alt>) <end-of-block>) <end-of-rule>)";
String found = g.getRule("synpred1_Expr").tree.toStringTree();
assertEquals(expecting, found);
}