/** Test method for {@link CPSHelper#getMicroFormattedString()}. */ @Test public final void testGetMicroFormattedString() throws FileNotFoundException, ParseException { InputStream in1 = new FileInputStream("Example-Microjava/Factorial.java"); InputStream in2 = new FileInputStream("Example-Microjava/Factorial.java"); syntaxtree.Node root1 = new MicroJavaParser(in1).Goal(); syntaxtree.Node root2 = new MicroJavaParser(in2).Goal(); String code1 = CPSHelper.getMicroFormattedString(root1); String code2 = CPSHelper.getMicroFormattedString(root2); assertEquals(code1, code2); }
/** Assert that node1 and node2 are equal MicroJava nodes. */ public void assertEqualMicroJavaNodes(Node expected, Node actual) { assertEquals( CPSHelper.getMicroFormattedString(expected), CPSHelper.getMicroFormattedString(actual)); }