use of ast.ErrorMessage.NotOkToStar in project L42 by ElvisResearchGroup.
the class TestLibrary method test.
@Test()
public void test() {
Program p = TestProgram.p(sProg);
ClassB cb1Pre = (ClassB) Desugar.of(Parser.parse(null, s1)).accept(new InjectionOnCore());
cb1Pre = new programReduction.Norm().norm(p.evilPush(cb1Pre));
TOut out;
try {
out = TypeSystem.instance().type(TIn.top(Phase.Coherent, p, cb1Pre));
} catch (NotOkToStar coh) {
assert s2 == ErrorKind.LibraryNotCoherent;
return;
}
if (s2 instanceof ErrorKind) {
assert !out.isOk();
ErrorKind kind = out.toError().kind;
assert kind == s2;
} else {
assert out.isOk() : "";
ClassB cb1 = (ClassB) out.toOk().annotated;
ClassB cbExpected = s2 == sameAsFormer ? cb1Pre : (ClassB) Desugar.of(Parser.parse(null, (String) s2)).accept(new InjectionOnCore());
TestHelper.assertEqualExp(cb1, cbExpected);
}
}
Aggregations