Exemplo n.º 1
0
 @Test
 public void testVarDecl() throws IOException, beaver.Parser.Exception {
   Program program = new MJFile("tests/junit/name_vardecl.java").parse();
   Assign assign = (Assign) program.getMain().getStmts(0);
   TypedVar decl = assign.decl();
   assertNotNull(decl);
   assertEquals("b", decl.getIdent());
 }
Exemplo n.º 2
0
 @Test
 public void testClassDecl() throws IOException, beaver.Parser.Exception {
   Program program = new MJFile("tests/junit/name_classdecl.java").parse();
   Assign assign = (Assign) program.getMain().getStmts(0);
   ObjAlloc alloc = (ObjAlloc) assign.getRhs();
   ClassDecl blubb = alloc.decl();
   assertNotNull(blubb);
   assertEquals("Blubb", blubb.getIdent());
 }