Add test cases for obsolete issues

#KT-3407 Obsolete
 #KT-4753 Obsolete
This commit is contained in:
Alexander Udalov
2015-06-09 22:00:03 +03:00
parent 5eb4a47a1a
commit f81c364999
10 changed files with 71 additions and 7 deletions
@@ -0,0 +1,6 @@
interface Base<T> {
void call(T t);
}
interface Derived extends Base<String> {
}
@@ -0,0 +1,5 @@
fun box(): String {
Base<String>{}.call("")
Derived{}.call("")
return "OK"
}
@@ -0,0 +1,8 @@
class ParamBase<T> {}
interface F<T> extends FBase<ParamBase<? extends T>> {
}
interface FBase<T> {
void call(T t);
}
@@ -0,0 +1,4 @@
fun box(): String {
F<ParamBase<Int>>({}).call(ParamBase())
return "OK"
}
@@ -0,0 +1,5 @@
public class ExtendsKCWithT extends KC {
public static String bar() {
return new ExtendsKCWithT().foo();
}
}
@@ -0,0 +1,9 @@
// KT-3407 Implementing (in Java) an abstract Kotlin class that implements a trait does not respect trait method definition
trait T {
fun foo() = "OK"
}
abstract class KC: T {}
fun box() = ExtendsKCWithT.bar()
@@ -526,6 +526,18 @@ public class BlackBoxAgainstJavaCodegenTestGenerated extends AbstractBlackBoxCod
doTestAgainstJava(fileName);
}
@TestMetadata("kt4753.kt")
public void testKt4753() throws Exception {
String fileName = JetTestUtils.navigationMetadata("compiler/testData/codegen/boxAgainstJava/sam/kt4753.kt");
doTestAgainstJava(fileName);
}
@TestMetadata("kt4753_2.kt")
public void testKt4753_2() throws Exception {
String fileName = JetTestUtils.navigationMetadata("compiler/testData/codegen/boxAgainstJava/sam/kt4753_2.kt");
doTestAgainstJava(fileName);
}
@TestMetadata("samConstructorGenericSignature.kt")
public void testSamConstructorGenericSignature() throws Exception {
String fileName = JetTestUtils.navigationMetadata("compiler/testData/codegen/boxAgainstJava/sam/samConstructorGenericSignature.kt");
@@ -71,12 +71,6 @@ public class BlackBoxWithJavaCodegenTestGenerated extends AbstractBlackBoxCodege
doTestWithJava(fileName);
}
@TestMetadata("trait")
public void testTrait() throws Exception {
String fileName = JetTestUtils.navigationMetadata("compiler/testData/codegen/boxWithJava/trait/");
doTestWithJava(fileName);
}
@TestMetadata("compiler/testData/codegen/boxWithJava/annotationsWithKClass")
@TestDataPath("$PROJECT_ROOT")
@RunWith(JUnit3RunnerWithInners.class)
@@ -133,6 +127,28 @@ public class BlackBoxWithJavaCodegenTestGenerated extends AbstractBlackBoxCodege
}
@TestMetadata("compiler/testData/codegen/boxWithJava/interfaces")
@TestDataPath("$PROJECT_ROOT")
@RunWith(JUnit3RunnerWithInners.class)
public static class Interfaces extends AbstractBlackBoxCodegenTest {
@TestMetadata("abstractClassInheritsFromInterface")
public void testAbstractClassInheritsFromInterface() throws Exception {
String fileName = JetTestUtils.navigationMetadata("compiler/testData/codegen/boxWithJava/interfaces/abstractClassInheritsFromInterface/");
doTestWithJava(fileName);
}
public void testAllFilesPresentInInterfaces() throws Exception {
JetTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("compiler/testData/codegen/boxWithJava/interfaces"), Pattern.compile("^([^\\.]+)$"), true);
}
@TestMetadata("inheritJavaInterface")
public void testInheritJavaInterface() throws Exception {
String fileName = JetTestUtils.navigationMetadata("compiler/testData/codegen/boxWithJava/interfaces/inheritJavaInterface/");
doTestWithJava(fileName);
}
}
@TestMetadata("compiler/testData/codegen/boxWithJava/jvmOverloads")
@TestDataPath("$PROJECT_ROOT")
@RunWith(JUnit3RunnerWithInners.class)
@@ -288,5 +304,4 @@ public class BlackBoxWithJavaCodegenTestGenerated extends AbstractBlackBoxCodege
}
}
}