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", ""));
}
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", ""));
}
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", ""));
}
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", ""));
}
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"));
}
Aggregations