Search in sources :

Example 96 with Model

use of abs.frontend.ast.Model in project abstools by abstools.

the class InterfaceDeclarationTest method trivial.

@Test
public void trivial() {
    Model p = assertParseOk("interface I {} {}");
    assertTrue(!p.getErrors().containsErrors());
}
Also used : Model(abs.frontend.ast.Model) Test(org.junit.Test) FrontendTest(abs.frontend.FrontendTest)

Example 97 with Model

use of abs.frontend.ast.Model in project abstools by abstools.

the class InterfaceDeclarationTest method mutuallyCircular.

@Test
public void mutuallyCircular() {
    Model p = assertParseOk("interface I extends J {} interface J extends I {} {}");
    assertEquals(2, p.getErrors().getErrorCount());
    Iterator<SemanticCondition> i = p.getErrors().iterator();
    assertEndsWith(i.next(), CYCLIC_INHERITANCE.withArgs("I"));
    assertEndsWith(i.next(), CYCLIC_INHERITANCE.withArgs("J"));
}
Also used : Model(abs.frontend.ast.Model) Test(org.junit.Test) FrontendTest(abs.frontend.FrontendTest)

Example 98 with Model

use of abs.frontend.ast.Model in project abstools by abstools.

the class InterfaceDeclarationTest method extendingUndefined.

@Test
public void extendingUndefined() {
    Model p = assertParseOk("interface J extends I {} {}");
    assertEquals(1, p.getErrors().getErrorCount());
    assertEndsWith(p.getErrors().getFirstError(), UNKOWN_INTERFACE.withArgs("I"));
}
Also used : Model(abs.frontend.ast.Model) Test(org.junit.Test) FrontendTest(abs.frontend.FrontendTest)

Example 99 with Model

use of abs.frontend.ast.Model in project abstools by abstools.

the class InterfaceDeclarationTest method circular.

@Test
public void circular() {
    Model p = assertParseOk("interface I extends I {} {}");
    assertEquals(1, p.getErrors().getErrorCount());
    assertEndsWith(p.getErrors().getFirstError(), CYCLIC_INHERITANCE.withArgs("I"));
}
Also used : Model(abs.frontend.ast.Model) Test(org.junit.Test) FrontendTest(abs.frontend.FrontendTest)

Example 100 with Model

use of abs.frontend.ast.Model in project abstools by abstools.

the class OtherAnalysisTests method awaitRewriteDecl2.

@Test
public void awaitRewriteDecl2() throws Exception {
    String deltaDecl = "delta D; modifies class C { adds Unit m() { return await this!m();}}";
    Model m = assertParseOk(deltaDecl);
    DeltaDecl d = m.findDelta("D");
    AwaitAsyncCall a = (AwaitAsyncCall) down(d);
    // pity, would like this to work.
    assertNotNull(a);
}
Also used : Model(abs.frontend.ast.Model) AwaitAsyncCall(abs.frontend.ast.AwaitAsyncCall) DeltaDecl(abs.frontend.ast.DeltaDecl) Test(org.junit.Test) FrontendTest(abs.frontend.FrontendTest)

Aggregations

Model (abs.frontend.ast.Model)224 Test (org.junit.Test)170 FrontendTest (abs.frontend.FrontendTest)93 ClassDecl (abs.frontend.ast.ClassDecl)57 DeltaDecl (abs.frontend.ast.DeltaDecl)30 SemanticConditionList (abs.frontend.analyser.SemanticConditionList)24 FunctionDecl (abs.frontend.ast.FunctionDecl)15 PrintStream (java.io.PrintStream)14 ModifyClassModifier (abs.frontend.ast.ModifyClassModifier)12 SkipStmt (abs.frontend.ast.SkipStmt)11 AbsNature (org.absmodels.abs.plugin.builder.AbsNature)11 ExpFunctionDef (abs.frontend.ast.ExpFunctionDef)9 ModuleDecl (abs.frontend.ast.ModuleDecl)9 CompilationUnit (abs.frontend.ast.CompilationUnit)7 DeltaTraitModifier (abs.frontend.ast.DeltaTraitModifier)7 ModifyMethodModifier (abs.frontend.ast.ModifyMethodModifier)7 PartialFunctionDecl (abs.frontend.ast.PartialFunctionDecl)7 PureExp (abs.frontend.ast.PureExp)7 TraitExpr (abs.frontend.ast.TraitExpr)7 WrongProgramArgumentException (abs.common.WrongProgramArgumentException)6