String result = ATNSerializer.getDecoded(atn, Arrays.asList(g.getTokenNames()));
assertEquals(expecting, result);
}
@Test public void testNot() throws Exception {
Grammar g = new Grammar(
"parser grammar T;\n"+
"tokens {A, B, C}\n" +
"a : ~A ;");
String expecting =
"max type 3\n" +
"0:RULE_START 0\n" +
"1:RULE_STOP 0\n" +
"2:BASIC 0\n" +
"3:BASIC 0\n" +
"4:BASIC 0\n" +
"rule 0:0\n" +
"0:A..A\n" +
"0->2 EPSILON 0,0,0\n" +
"2->3 NOT_SET 0,0,0\n" +
"3->1 EPSILON 0,0,0\n";
ATN atn = createATN(g, true);
DOTGenerator gen = new DOTGenerator(g);
System.out.println(gen.getDOT(atn.ruleToStartState[0]));
String result = ATNSerializer.getDecoded(atn, Arrays.asList(g.getTokenNames()));
assertEquals(expecting, result);
}