Added sam test on java8 interface with default method
This commit is contained in:
+6
@@ -47,4 +47,10 @@ public class BlackBoxWithJava8CodegenTestGenerated extends AbstractBlackBoxCodeg
|
||||
doTestWithJava(fileName);
|
||||
}
|
||||
|
||||
@TestMetadata("samOnInterfaceWithDefaultMethod")
|
||||
public void testSamOnInterfaceWithDefaultMethod() throws Exception {
|
||||
String fileName = JetTestUtils.navigationMetadata("compiler/testData/codegen/java8/boxWithJava/samOnInterfaceWithDefaultMethod/");
|
||||
doTestWithJava(fileName);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
+5
@@ -0,0 +1,5 @@
|
||||
class JavaCall {
|
||||
String call(Test test) {
|
||||
return test.call();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,12 @@
|
||||
interface Test {
|
||||
|
||||
String call();
|
||||
|
||||
default String test() {
|
||||
return "K";
|
||||
}
|
||||
|
||||
static String testStatic() {
|
||||
return "K";
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,3 @@
|
||||
fun box(): String {
|
||||
return JavaCall().call {"OK"}
|
||||
}
|
||||
+1
-2
@@ -153,8 +153,7 @@ public abstract class AbstractBlackBoxCodegenTest extends CodegenTestCase {
|
||||
File kotlinOut = JetTestUtils.tmpDir(toString());
|
||||
OutputUtilsPackage.writeAllTo(classFileFactory, kotlinOut);
|
||||
|
||||
// TODO: support several Java sources
|
||||
File javaOut = compileJava(KotlinPackage.single(javaFilePaths), kotlinOut.getPath());
|
||||
File javaOut = compileJava(javaFilePaths, kotlinOut.getPath());
|
||||
// Add javac output to classpath so that the created class loader can find generated Java classes
|
||||
addJvmClasspathRoot(configuration, javaOut);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user