예제 #1
0
  /** Test method for {@link CPSHelper#getFormattedString()}. */
  @Test
  public final void testGetFormattedString() throws FileNotFoundException, nano.ParseException {
    InputStream in1 = new FileInputStream("Example-Nanojava/SimpleSum.java");
    InputStream in2 = new FileInputStream("Example-Nanojava/SimpleSum.java");
    nano.syntaxtree.Node root1 = new NanoJavaParser(in1).Goal();
    nano.syntaxtree.Node root2 = new NanoJavaParser(in2).Goal();

    String code1 = CPSHelper.getFormattedString(root1);
    String code2 = CPSHelper.getFormattedString(root2);

    assertEquals(code1, code2);
  }
예제 #2
0
 /** Assert that node1 and node2 are equal NanoJava nodes. */
 public void assertEqualNanoJavaNodes(nano.syntaxtree.Node expected, nano.syntaxtree.Node actual) {
   assertEquals(CPSHelper.getFormattedString(expected), CPSHelper.getFormattedString(actual));
 }