Fix capturing variables declared via destructuring (#KT-14535 fixed).

This commit is contained in:
Anton Bannykh
2016-10-31 20:42:34 +03:00
parent bb4d8f9223
commit 2fb7b01320
5 changed files with 26 additions and 24 deletions
@@ -31,24 +31,6 @@ import java.util.regex.Pattern;
@TestDataPath("$PROJECT_ROOT")
@RunWith(JUnit3RunnerWithInners.class)
public class MultiDeclarationTestsGenerated extends AbstractMultiDeclarationTests {
@TestMetadata("VarCapturedInFunctionLiteral.kt")
public void ignoredVarCapturedInFunctionLiteral() throws Exception {
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/multiDecl/VarCapturedInFunctionLiteral.kt");
doTest(fileName);
}
@TestMetadata("VarCapturedInLocalFunction.kt")
public void ignoredVarCapturedInLocalFunction() throws Exception {
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/multiDecl/VarCapturedInLocalFunction.kt");
doTest(fileName);
}
@TestMetadata("VarCapturedInObjectLiteral.kt")
public void ignoredVarCapturedInObjectLiteral() throws Exception {
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/multiDecl/VarCapturedInObjectLiteral.kt");
doTest(fileName);
}
public void testAllFilesPresentInMultiDecl() throws Exception {
KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("compiler/testData/codegen/box/multiDecl"), Pattern.compile("^(.+)\\.kt$"), true);
}
@@ -119,6 +101,24 @@ public class MultiDeclarationTestsGenerated extends AbstractMultiDeclarationTest
doTest(fileName);
}
@TestMetadata("VarCapturedInFunctionLiteral.kt")
public void testVarCapturedInFunctionLiteral() throws Exception {
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/multiDecl/VarCapturedInFunctionLiteral.kt");
doTest(fileName);
}
@TestMetadata("VarCapturedInLocalFunction.kt")
public void testVarCapturedInLocalFunction() throws Exception {
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/multiDecl/VarCapturedInLocalFunction.kt");
doTest(fileName);
}
@TestMetadata("VarCapturedInObjectLiteral.kt")
public void testVarCapturedInObjectLiteral() throws Exception {
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/multiDecl/VarCapturedInObjectLiteral.kt");
doTest(fileName);
}
@TestMetadata("compiler/testData/codegen/box/multiDecl/forIterator")
@TestDataPath("$PROJECT_ROOT")
@RunWith(JUnit3RunnerWithInners.class)