KT-11960: add test for case of instantiating inner class of a local class

This commit is contained in:
Alexey Andreev
2016-05-30 11:13:39 +03:00
parent acc5303731
commit 2bd807bb4e
7 changed files with 174 additions and 0 deletions
@@ -187,4 +187,8 @@ public final class ClosureTest extends SingleFileTranslationTest {
public void testClosureThisInLambdaInsideObject() throws Exception {
checkFooBoxIsOk();
}
public void testLambdaInLocalFun() throws Exception {
checkFooBoxIsOk();
}
}
@@ -31,6 +31,12 @@ import java.util.regex.Pattern;
@TestDataPath("$PROJECT_ROOT")
@RunWith(JUnit3RunnerWithInners.class)
public class LocalClassesTestGenerated extends AbstractLocalClassesTest {
@TestMetadata("ownClosureOfInnerLocalClass.kt")
public void ignoredOwnClosureOfInnerLocalClass() throws Exception {
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/localClasses/ownClosureOfInnerLocalClass.kt");
doTest(fileName);
}
public void testAllFilesPresentInLocalClasses() throws Exception {
KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("compiler/testData/codegen/box/localClasses"), Pattern.compile("^(.+)\\.kt$"), true);
}
@@ -47,6 +53,18 @@ public class LocalClassesTestGenerated extends AbstractLocalClassesTest {
doTest(fileName);
}
@TestMetadata("closureOfInnerLocalClass.kt")
public void testClosureOfInnerLocalClass() throws Exception {
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/localClasses/closureOfInnerLocalClass.kt");
doTest(fileName);
}
@TestMetadata("closureOfLambdaInLocalClass.kt")
public void testClosureOfLambdaInLocalClass() throws Exception {
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/localClasses/closureOfLambdaInLocalClass.kt");
doTest(fileName);
}
@TestMetadata("closureWithSelfInstantiation.kt")
public void testClosureWithSelfInstantiation() throws Exception {
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/localClasses/closureWithSelfInstantiation.kt");