Search in sources :

Example 26 with Model

use of org.abs_models.frontend.ast.Model in project abstools by abstools.

the class DuplicateCheckTest method datatypeDuplicates.

@Test
public void datatypeDuplicates() {
    Model p = assertParse("data D; data D;");
    assertContains(p.typeCheck().getFirstError(), ErrorMessage.DUPLICATE_TYPE_DECL.withArgs("D", ""));
}
Also used : Model(org.abs_models.frontend.ast.Model) FrontendTest(org.abs_models.frontend.FrontendTest) Test(org.junit.Test)

Example 27 with Model

use of org.abs_models.frontend.ast.Model in project abstools by abstools.

the class DuplicateCheckTest method interfaceDuplicates.

@Test
public void interfaceDuplicates() {
    Model p = assertParse("interface I {} interface I {}");
    assertContains(p.typeCheck().getFirstError(), ErrorMessage.DUPLICATE_TYPE_DECL.withArgs("I", ""));
}
Also used : Model(org.abs_models.frontend.ast.Model) FrontendTest(org.abs_models.frontend.FrontendTest) Test(org.junit.Test)

Example 28 with Model

use of org.abs_models.frontend.ast.Model in project abstools by abstools.

the class DuplicateCheckTest method duplicateFunctions.

@Test
public void duplicateFunctions() {
    Model p = assertParse("data Test = Test; def Test zero() = Test; def Test zero() = Test;");
    assertContains(p.typeCheck().getFirstError(), ErrorMessage.DUPLICATE_FUN_NAME.withArgs("zero", ""));
}
Also used : Model(org.abs_models.frontend.ast.Model) FrontendTest(org.abs_models.frontend.FrontendTest) Test(org.junit.Test)

Example 29 with Model

use of org.abs_models.frontend.ast.Model in project abstools by abstools.

the class DuplicateCheckTest method typeDuplicates.

@Test
public void typeDuplicates() {
    Model p = assertParse("data D; interface D { }");
    assertContains(p.typeCheck().getFirstError(), ErrorMessage.DUPLICATE_TYPE_DECL.withArgs("D", ""));
}
Also used : Model(org.abs_models.frontend.ast.Model) FrontendTest(org.abs_models.frontend.FrontendTest) Test(org.junit.Test)

Example 30 with Model

use of org.abs_models.frontend.ast.Model in project abstools by abstools.

the class InterfaceDeclarationTest method mutuallyCircular.

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

Aggregations

Model (org.abs_models.frontend.ast.Model)268 Test (org.junit.Test)227 FrontendTest (org.abs_models.frontend.FrontendTest)101 ClassDecl (org.abs_models.frontend.ast.ClassDecl)72 DeltaDecl (org.abs_models.frontend.ast.DeltaDecl)34 SemanticConditionList (org.abs_models.frontend.analyser.SemanticConditionList)29 ABSTest (org.abs_models.ABSTest)22 ProductDecl (org.abs_models.frontend.ast.ProductDecl)17 FunctionDecl (org.abs_models.frontend.ast.FunctionDecl)15 HashSet (java.util.HashSet)13 ModifyClassModifier (org.abs_models.frontend.ast.ModifyClassModifier)13 PrintStream (java.io.PrintStream)12 Product (org.abs_models.frontend.ast.Product)11 SkipStmt (org.abs_models.frontend.ast.SkipStmt)11 VarUse (org.abs_models.frontend.ast.VarUse)11 Feature (org.abs_models.frontend.ast.Feature)10 File (java.io.File)9 ExpFunctionDef (org.abs_models.frontend.ast.ExpFunctionDef)9 ReturnStmt (org.abs_models.frontend.ast.ReturnStmt)9 KindedName (org.abs_models.frontend.typechecker.KindedName)9