Added tests with SAM adapter inherited in Kotlin class.
This commit is contained in:
@@ -0,0 +1,5 @@
|
||||
class JavaClass {
|
||||
public void run(Runnable r) {
|
||||
r.run();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,8 @@
|
||||
class KotlinSubclass: JavaClass() {
|
||||
}
|
||||
|
||||
fun box(): String {
|
||||
var v = "FAIL"
|
||||
KotlinSubclass().run { v = "OK" }
|
||||
return v
|
||||
}
|
||||
+13
@@ -0,0 +1,13 @@
|
||||
package test
|
||||
|
||||
public final class Sub : test.Super {
|
||||
public constructor Sub()
|
||||
internal open override /*1*/ /*fake_override*/ fun foo(/*0*/ r: (() -> jet.Unit)?): jet.Unit
|
||||
internal open override /*1*/ /*fake_override*/ fun foo(/*0*/ r: java.lang.Runnable?): jet.Unit
|
||||
}
|
||||
|
||||
public open class Super : java.lang.Object {
|
||||
public constructor Super()
|
||||
public/*package*/ open /*synthesized*/ fun foo(/*0*/ r: (() -> jet.Unit)?): jet.Unit
|
||||
public/*package*/ open fun foo(/*0*/ r: java.lang.Runnable?): jet.Unit
|
||||
}
|
||||
+4
@@ -0,0 +1,4 @@
|
||||
package test
|
||||
|
||||
public class Sub: Super() {
|
||||
}
|
||||
+5
@@ -0,0 +1,5 @@
|
||||
package test;
|
||||
|
||||
public class Super {
|
||||
void foo(Runnable r);
|
||||
}
|
||||
+5
@@ -150,6 +150,11 @@ public class BlackBoxWithJavaCodegenTestGenerated extends AbstractBlackBoxCodege
|
||||
doTestWithJava("compiler/testData/codegen/boxWithJava/samAdapters/fileFilter.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("inheritedInKotlin.kt")
|
||||
public void testInheritedInKotlin() throws Exception {
|
||||
doTestWithJava("compiler/testData/codegen/boxWithJava/samAdapters/inheritedInKotlin.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("inheritedOverriddenAdapter.kt")
|
||||
public void testInheritedOverriddenAdapter() throws Exception {
|
||||
doTestWithJava("compiler/testData/codegen/boxWithJava/samAdapters/inheritedOverriddenAdapter.kt");
|
||||
|
||||
@@ -1409,12 +1409,31 @@ public class LoadJavaTestGenerated extends AbstractLoadJavaTest {
|
||||
}
|
||||
|
||||
@TestMetadata("compiler/testData/loadJava/javaAgainstKotlin")
|
||||
@InnerTestClasses({JavaAgainstKotlin.SignaturePropagation.class, JavaAgainstKotlin.Visibility.class})
|
||||
@InnerTestClasses({JavaAgainstKotlin.SamAdapters.class, JavaAgainstKotlin.SignaturePropagation.class, JavaAgainstKotlin.Visibility.class})
|
||||
public static class JavaAgainstKotlin extends AbstractLoadJavaTest {
|
||||
public void testAllFilesPresentInJavaAgainstKotlin() throws Exception {
|
||||
JetTestUtils.assertAllTestsPresentByMetadata(this.getClass(), "org.jetbrains.jet.generators.tests.GenerateTests", new File("compiler/testData/loadJava/javaAgainstKotlin"), Pattern.compile("^(.+)\\.txt$"), true);
|
||||
}
|
||||
|
||||
@TestMetadata("compiler/testData/loadJava/javaAgainstKotlin/samAdapters")
|
||||
@InnerTestClasses({})
|
||||
public static class SamAdapters extends AbstractLoadJavaTest {
|
||||
public void testAllFilesPresentInSamAdapters() throws Exception {
|
||||
JetTestUtils.assertAllTestsPresentByMetadata(this.getClass(), "org.jetbrains.jet.generators.tests.GenerateTests", new File("compiler/testData/loadJava/javaAgainstKotlin/samAdapters"), Pattern.compile("^(.+)\\.txt$"), true);
|
||||
}
|
||||
|
||||
@TestMetadata("InheritSamAdapterInKotlin.txt")
|
||||
public void testInheritSamAdapterInKotlin() throws Exception {
|
||||
doTestJavaAgainstKotlin("compiler/testData/loadJava/javaAgainstKotlin/samAdapters/InheritSamAdapterInKotlin.txt");
|
||||
}
|
||||
|
||||
public static Test innerSuite() {
|
||||
TestSuite suite = new TestSuite("SamAdapters");
|
||||
suite.addTestSuite(SamAdapters.class);
|
||||
return suite;
|
||||
}
|
||||
}
|
||||
|
||||
@TestMetadata("compiler/testData/loadJava/javaAgainstKotlin/signaturePropagation")
|
||||
@InnerTestClasses({})
|
||||
public static class SignaturePropagation extends AbstractLoadJavaTest {
|
||||
@@ -1481,6 +1500,7 @@ public class LoadJavaTestGenerated extends AbstractLoadJavaTest {
|
||||
public static Test innerSuite() {
|
||||
TestSuite suite = new TestSuite("JavaAgainstKotlin");
|
||||
suite.addTestSuite(JavaAgainstKotlin.class);
|
||||
suite.addTest(SamAdapters.innerSuite());
|
||||
suite.addTest(SignaturePropagation.innerSuite());
|
||||
suite.addTest(Visibility.innerSuite());
|
||||
return suite;
|
||||
|
||||
Reference in New Issue
Block a user