Search in sources :

Example 6 with PartialFunctionDecl

use of abs.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"));
}
Also used : PrintStream(java.io.PrintStream) Model(abs.frontend.ast.Model) ByteArrayOutputStream(java.io.ByteArrayOutputStream) PartialFunctionDecl(abs.frontend.ast.PartialFunctionDecl) Test(org.junit.Test)

Example 7 with PartialFunctionDecl

use of abs.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"));
}
Also used : PrintStream(java.io.PrintStream) Model(abs.frontend.ast.Model) ArrayList(java.util.ArrayList) ByteArrayOutputStream(java.io.ByteArrayOutputStream) PartialFunctionDecl(abs.frontend.ast.PartialFunctionDecl) ReachabilityInformation(abs.backend.prolog.ReachabilityInformation) Test(org.junit.Test)

Aggregations

Model (abs.frontend.ast.Model)7 PartialFunctionDecl (abs.frontend.ast.PartialFunctionDecl)7 Test (org.junit.Test)7 ByteArrayOutputStream (java.io.ByteArrayOutputStream)4 PrintStream (java.io.PrintStream)4 DefaultABSFormatter (abs.backend.prettyprint.DefaultABSFormatter)1 ReachabilityInformation (abs.backend.prolog.ReachabilityInformation)1 PrintWriter (java.io.PrintWriter)1 StringWriter (java.io.StringWriter)1 ArrayList (java.util.ArrayList)1