Save annotations of lambda on SAM's method

Also add tests checking that annotations on 'invoke' methods of common lambdas are saved properly

 #KT-6932 Fixed
This commit is contained in:
Denis Zharkov
2015-05-12 10:45:06 +03:00
parent e078eaf15b
commit e98b9ea84e
9 changed files with 180 additions and 3 deletions
@@ -35,6 +35,18 @@ public class BlackBoxWithJavaCodegenTestGenerated extends AbstractBlackBoxCodege
JetTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("compiler/testData/codegen/boxWithJava"), Pattern.compile("^([^\\.]+)$"), true);
}
@TestMetadata("annotatedSamFunExpression")
public void testAnnotatedSamFunExpression() throws Exception {
String fileName = JetTestUtils.navigationMetadata("compiler/testData/codegen/boxWithJava/annotatedSamFunExpression/");
doTestWithJava(fileName);
}
@TestMetadata("annotatedSamLambda")
public void testAnnotatedSamLambda() throws Exception {
String fileName = JetTestUtils.navigationMetadata("compiler/testData/codegen/boxWithJava/annotatedSamLambda/");
doTestWithJava(fileName);
}
@TestMetadata("classObjectAccessor")
public void testClassObjectAccessor() throws Exception {
String fileName = JetTestUtils.navigationMetadata("compiler/testData/codegen/boxWithJava/classObjectAccessor/");
@@ -102,6 +102,27 @@ public class BlackBoxWithStdlibCodegenTestGenerated extends AbstractBlackBoxCode
String fileName = JetTestUtils.navigationMetadata("compiler/testData/codegen/boxWithStdlib/annotations/varargInAnnotationParameter.kt");
doTestWithStdlib(fileName);
}
@TestMetadata("compiler/testData/codegen/boxWithStdlib/annotations/annotatedLambda")
@TestDataPath("$PROJECT_ROOT")
@RunWith(JUnit3RunnerWithInners.class)
public static class AnnotatedLambda extends AbstractBlackBoxCodegenTest {
public void testAllFilesPresentInAnnotatedLambda() throws Exception {
JetTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("compiler/testData/codegen/boxWithStdlib/annotations/annotatedLambda"), Pattern.compile("^(.+)\\.kt$"), true);
}
@TestMetadata("funExpression.kt")
public void testFunExpression() throws Exception {
String fileName = JetTestUtils.navigationMetadata("compiler/testData/codegen/boxWithStdlib/annotations/annotatedLambda/funExpression.kt");
doTestWithStdlib(fileName);
}
@TestMetadata("lambda.kt")
public void testLambda() throws Exception {
String fileName = JetTestUtils.navigationMetadata("compiler/testData/codegen/boxWithStdlib/annotations/annotatedLambda/lambda.kt");
doTestWithStdlib(fileName);
}
}
}
@TestMetadata("compiler/testData/codegen/boxWithStdlib/arrays")