use of abs.frontend.ast.AwaitAsyncCall 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);
}
use of abs.frontend.ast.AwaitAsyncCall in project abstools by abstools.
the class OtherAnalysisTests method testContext1.
@Test
public void testContext1() {
// FIXME: the code in this example is incorrect (no await statement in init block allowed)
Model m = assertParseOk("data Unit; interface I { Unit m(); } class C implements I {{Unit x = await this!m();}}");
ClassDecl cd = (ClassDecl) m.lookupModule("UnitTest").getDecl(2);
AwaitAsyncCall n = (AwaitAsyncCall) down(cd);
assertNull("Rewrite failed!", n);
}
use of abs.frontend.ast.AwaitAsyncCall in project abstools by abstools.
the class OtherAnalysisTests method testContext2.
@Test
public void testContext2() {
// FIXME: the code in this example is incorrect (no await statement in init block allowed)
Model m = assertParseOk("data Unit; interface I { Unit m(); } class C implements I {{Unit x = await this!m();}}");
ClassDecl cd = (ClassDecl) m.lookupModule("UnitTest").getDecl(2);
AwaitAsyncCall n = (AwaitAsyncCall) down(cd);
assertNull("Rewriting failed!", n);
}
use of abs.frontend.ast.AwaitAsyncCall in project abstools by abstools.
the class OtherAnalysisTests method awaitRewriteDecl1.
@Test
public void awaitRewriteDecl1() {
Model m = assertParseOk("module A; class C { } delta D; modifies class C { adds Unit m() { return await this!m();}}", Config.WITH_STD_LIB);
DeltaDecl c = m.getDeltaDecls().iterator().next();
AwaitAsyncCall a = (AwaitAsyncCall) down(c);
// pity, would like this to work.
assertNotNull(a);
}
Aggregations