IR to CFG: when implementation in function generator, some when tests

This commit is contained in:
Mikhail Glukhikh
2016-09-22 16:18:37 +03:00
committed by Dmitry Petrov
parent eaf10a4675
commit 979f2231a1
17 changed files with 492 additions and 4 deletions
@@ -70,4 +70,43 @@ public class IrCfgTestCaseGenerated extends AbstractIrCfgTestCase {
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/ir/irCfg/simpleReturn.kt");
doTest(fileName);
}
@TestMetadata("compiler/testData/ir/irCfg/when")
@TestDataPath("$PROJECT_ROOT")
@RunWith(JUnit3RunnerWithInners.class)
public static class When extends AbstractIrCfgTestCase {
public void testAllFilesPresentInWhen() throws Exception {
KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("compiler/testData/ir/irCfg/when"), Pattern.compile("^(.+)\\.kt$"), true);
}
@TestMetadata("cascadeIf.kt")
public void testCascadeIf() throws Exception {
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/ir/irCfg/when/cascadeIf.kt");
doTest(fileName);
}
@TestMetadata("emptyWhen.kt")
public void testEmptyWhen() throws Exception {
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/ir/irCfg/when/emptyWhen.kt");
doTest(fileName);
}
@TestMetadata("expressionIf.kt")
public void testExpressionIf() throws Exception {
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/ir/irCfg/when/expressionIf.kt");
doTest(fileName);
}
@TestMetadata("ifChain.kt")
public void testIfChain() throws Exception {
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/ir/irCfg/when/ifChain.kt");
doTest(fileName);
}
@TestMetadata("whenReturn.kt")
public void testWhenReturn() throws Exception {
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/ir/irCfg/when/whenReturn.kt");
doTest(fileName);
}
}
}
@@ -658,6 +658,12 @@ public class IrTextTestCaseGenerated extends AbstractIrTextTestCase {
doTest(fileName);
}
@TestMetadata("whenReturn.kt")
public void testWhenReturn() throws Exception {
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/ir/irText/expressions/whenReturn.kt");
doTest(fileName);
}
@TestMetadata("whileDoWhile.kt")
public void testWhileDoWhile() throws Exception {
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/ir/irText/expressions/whileDoWhile.kt");