Generate local variable table for inlined lambda

This commit is contained in:
Mikhael Bogdanov
2014-03-19 17:45:46 +04:00
parent 75c57f9827
commit 93367ffd3b
9 changed files with 162 additions and 31 deletions
@@ -137,7 +137,7 @@ public abstract class AbstractCheckLocalVariablesTableTest extends TestCaseWithT
private List<LocalVariable> parseExpectations() throws IOException {
List<String> lines = Files.readLines(ktFile, Charset.forName("utf-8"));
List<LocalVariable> expectedLocalVariables = new ArrayList<LocalVariable>();
for (int i = lines.size() - 3; i < lines.size(); ++i) {
for (int i = Math.max(lines.size() - 10, 0); i < lines.size(); ++i) {
Matcher nameMatcher = namePattern.matcher(lines.get(i));
if (nameMatcher.matches()) {
Matcher typeMatcher = typePattern.matcher(lines.get(i));
@@ -41,6 +41,26 @@ public class CheckLocalVariablesTableTestGenerated extends AbstractCheckLocalVar
doTest("compiler/testData/checkLocalVariablesTable/copyFunction.kt");
}
@TestMetadata("inlineLambdaWithItParam.kt")
public void testInlineLambdaWithItParam() throws Exception {
doTest("compiler/testData/checkLocalVariablesTable/inlineLambdaWithItParam.kt");
}
@TestMetadata("inlineLambdaWithParam.kt")
public void testInlineLambdaWithParam() throws Exception {
doTest("compiler/testData/checkLocalVariablesTable/inlineLambdaWithParam.kt");
}
@TestMetadata("inlineSimple.kt")
public void testInlineSimple() throws Exception {
doTest("compiler/testData/checkLocalVariablesTable/inlineSimple.kt");
}
@TestMetadata("inlineSimpleChain.kt")
public void testInlineSimpleChain() throws Exception {
doTest("compiler/testData/checkLocalVariablesTable/inlineSimpleChain.kt");
}
@TestMetadata("itInLambda.kt")
public void testItInLambda() throws Exception {
doTest("compiler/testData/checkLocalVariablesTable/itInLambda.kt");