use of org.abs_models.frontend.ast.PartialFunctionDecl in project abstools by abstools.
the class PartialFunctionTest method prettyPrintImplemented.
@Test
public void prettyPrintImplemented() throws NotImplementedYetException, IOException {
Model model = expand(parse("apply(inc)(0);", applyFunction(), incFunction()));
PartialFunctionDecl func = getPartialFunction(model, "apply");
assertNotNull(func);
String printed;
try (StringWriter writer = new StringWriter();
PrintWriter pw = new PrintWriter(writer)) {
func.doPrettyPrint(pw, new DefaultABSFormatter(pw));
printed = writer.toString();
}
assertFalse(printed.isEmpty());
}
use of org.abs_models.frontend.ast.PartialFunctionDecl in project abstools by abstools.
the class PartialFunctionTest method noDynamicJavaCodeGenerated.
@Test
public void noDynamicJavaCodeGenerated() throws NotImplementedYetException, UnsupportedEncodingException {
Model model = expand(parse("apply(inc)(0);", applyFunction(), incFunction()));
PartialFunctionDecl func = getPartialFunction(model, "apply");
assertNotNull(func);
ByteArrayOutputStream os = new ByteArrayOutputStream();
func.generateJavaDynamic(new PrintStream(os));
assertEquals("", os.toString("utf-8"));
}
use of org.abs_models.frontend.ast.PartialFunctionDecl in project abstools by abstools.
the class PartialFunctionTest method noPrologCodeGenerated.
@Test
public void noPrologCodeGenerated() throws NotImplementedYetException, UnsupportedEncodingException {
Model model = expand(parse("apply(inc)(0);", applyFunction(), incFunction()));
PartialFunctionDecl func = getPartialFunction(model, "apply");
assertNotNull(func);
ByteArrayOutputStream os = new ByteArrayOutputStream();
func.generateProlog(new PrintStream(os), new ReachabilityInformation(new ArrayList<>()));
assertEquals("", os.toString("utf-8"));
}
use of org.abs_models.frontend.ast.PartialFunctionDecl in project abstools by abstools.
the class PartialFunctionTest method noErlangCodeGenerated.
@Test
public void noErlangCodeGenerated() throws IOException, NotImplementedYetException {
Model model = expand(parse("apply(inc)(0);", applyFunction(), incFunction()));
PartialFunctionDecl func = getPartialFunction(model, "apply");
assertNotNull(func);
func.generateErlangCode(null);
}
use of org.abs_models.frontend.ast.PartialFunctionDecl in project abstools by abstools.
the class PartialFunctionTest method noJavaCodeGenerated.
@Test
public void noJavaCodeGenerated() throws NotImplementedYetException, UnsupportedEncodingException {
Model model = expand(parse("apply(inc)(0);", applyFunction(), incFunction()));
PartialFunctionDecl func = getPartialFunction(model, "apply");
assertNotNull(func);
ByteArrayOutputStream os = new ByteArrayOutputStream();
func.generateJava(new PrintStream(os));
assertEquals("", os.toString("utf-8"));
}
Aggregations