Generate proper initialization for possibly nullable SAM wrapper

#KT-18916 Fixed Target versions 1.1.5
This commit is contained in:
Dmitry Petrov
2017-07-10 10:26:41 +03:00
parent b99007961f
commit 8a9707c140
4 changed files with 81 additions and 15 deletions
@@ -1920,6 +1920,27 @@ public class BytecodeTextTestGenerated extends AbstractBytecodeTextTest {
}
}
@TestMetadata("compiler/testData/codegen/bytecodeText/sam")
@TestDataPath("$PROJECT_ROOT")
@RunWith(JUnit3RunnerWithInners.class)
public static class Sam extends AbstractBytecodeTextTest {
public void testAllFilesPresentInSam() throws Exception {
KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("compiler/testData/codegen/bytecodeText/sam"), Pattern.compile("^(.+)\\.kt$"), TargetBackend.ANY, true);
}
@TestMetadata("samWrapperForNullInitialization.kt")
public void testSamWrapperForNullInitialization() throws Exception {
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/bytecodeText/sam/samWrapperForNullInitialization.kt");
doTest(fileName);
}
@TestMetadata("samWrapperForNullableInitialization.kt")
public void testSamWrapperForNullableInitialization() throws Exception {
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/bytecodeText/sam/samWrapperForNullableInitialization.kt");
doTest(fileName);
}
}
@TestMetadata("compiler/testData/codegen/bytecodeText/statements")
@TestDataPath("$PROJECT_ROOT")
@RunWith(JUnit3RunnerWithInners.class)