checkExpected(createdFunctionDef, expected);
}
private void checkExpected(SimpleNode functionDef, String expected) throws Exception {
MakeAstValidForPrettyPrintingVisitor.makeValid(functionDef);
PrettyPrinterV2 printer = new PrettyPrinterV2(new PrettyPrinterPrefsV2("\n", " ",
new IGrammarVersionProvider() {
public int getGrammarVersion() throws MisconfigurationException {
return IGrammarVersionProvider.GRAMMAR_PYTHON_VERSION_2_7;
}
}));
String result = printer.print(functionDef);
System.out.println("Result: >>" + result +
"<<");
assertEquals(expected, result);
}