Migrate boxAgainstJava tests to multi-file framework

This commit is contained in:
Alexander Udalov
2016-03-01 16:28:53 +03:00
parent 26de87d792
commit 280ad195ee
251 changed files with 2010 additions and 1399 deletions
@@ -1,12 +0,0 @@
public class funCallInConstructor {
protected final String protectedProperty;
public funCallInConstructor(String str) {
protectedProperty = str;
}
protected static String protectedFun() {
return "OK";
}
}
@@ -1,9 +1,25 @@
class A: funCallInConstructor(funCallInConstructor.protectedFun()) {
fun test(): String {
return protectedProperty!!
}
// FILE: J.java
public class J {
protected final String protectedProperty;
public J(String str) {
protectedProperty = str;
}
protected static String protectedFun() {
return "OK";
}
}
// FILE: 1.kt
class A : J(J.protectedFun()) {
fun test(): String {
return protectedProperty!!
}
}
fun box(): String {
return A().test()
return A().test()
}
@@ -1,6 +0,0 @@
public class funClassObject {
protected static String protectedFun() {
return "OK";
}
}
@@ -1,11 +1,21 @@
class A {
companion object: funClassObject() {
fun test(): String {
return funClassObject.protectedFun()!!
// FILE: J.java
public class J {
protected static String protectedFun() {
return "OK";
}
}
// FILE: 1.kt
class A {
companion object : J() {
fun test(): String {
return J.protectedFun()!!
}
}
}
}
fun box(): String {
return A.test()
return A.test()
}
@@ -1,5 +0,0 @@
public class funGenericClass<T> {
protected static String protectedFun() {
return "OK";
}
}
@@ -1,9 +1,19 @@
class Derived(): funGenericClass<String>() {
// FILE: J.java
public class J<T> {
protected static String protectedFun() {
return "OK";
}
}
// FILE: 1.kt
class Derived : J<String>() {
fun test(): String {
return funGenericClass.protectedFun()!!
return J.protectedFun()!!
}
}
fun box(): String {
return Derived().test()
return Derived().test()
}
@@ -1,7 +0,0 @@
public class funNestedStaticClass {
public static class Inner {
protected static String protectedFun() {
return "OK";
}
}
}
@@ -1,9 +1,21 @@
class Derived(): funNestedStaticClass.Inner() {
// FILE: J.java
public class J {
public static class Inner {
protected static String protectedFun() {
return "OK";
}
}
}
// FILE: 1.kt
class Derived : J.Inner() {
fun test(): String {
return funNestedStaticClass.Inner.protectedFun()!!
return J.Inner.protectedFun()!!
}
}
fun box(): String {
return Derived().test()
return Derived().test()
}
@@ -1,9 +0,0 @@
public class funNestedStaticClass2 {
public static class A {
public static class B {
protected static String protectedFun() {
return "OK";
}
}
}
}
@@ -1,9 +1,23 @@
class Derived(): funNestedStaticClass2.A.B() {
// FILE: J.java
public class J {
public static class A {
public static class B {
protected static String protectedFun() {
return "OK";
}
}
}
}
// FILE: 1.kt
class Derived : J.A.B() {
fun test(): String {
return funNestedStaticClass2.A.B.protectedFun()!!
return J.A.B.protectedFun()!!
}
}
fun box(): String {
return Derived().test()
return Derived().test()
}
@@ -1,7 +0,0 @@
public class funNestedStaticGenericClass<T> {
public static class Inner<S> {
protected static String protectedFun() {
return "OK";
}
}
}
@@ -1,9 +1,21 @@
class Derived(): funNestedStaticGenericClass.Inner<String>() {
// FILE: J.java
public class J<T> {
public static class Inner<S> {
protected static String protectedFun() {
return "OK";
}
}
}
// FILE: 1.kt
class Derived : J.Inner<String>() {
fun test(): String {
return funNestedStaticGenericClass.Inner.protectedFun()!!
return J.Inner.protectedFun()!!
}
}
fun box(): String {
return Derived().test()
return Derived().test()
}
@@ -1,5 +0,0 @@
public class funNotDirectSuperClass {
protected static String protectedFun() {
return "OK";
}
}
@@ -1,12 +1,21 @@
open class A : funNotDirectSuperClass() {}
// FILE: J.java
class Derived(): A() {
public class J {
protected static String protectedFun() {
return "OK";
}
}
// FILE: 1.kt
open class A : J() {}
class Derived : A() {
fun test(): String {
return funNotDirectSuperClass.protectedFun()!!
return J.protectedFun()!!
}
}
fun box(): String {
return Derived().test()
return Derived().test()
}
@@ -1,6 +0,0 @@
public class funObject {
protected static String protectedFun() {
return "OK";
}
}
@@ -1,9 +1,19 @@
object A: funObject() {
fun test(): String {
return funObject.protectedFun()!!
}
// FILE: J.java
public class J {
protected static String protectedFun() {
return "OK";
}
}
// FILE: 1.kt
object A : J() {
fun test(): String {
return J.protectedFun()!!
}
}
fun box(): String {
return A.test()
return A.test()
}
@@ -1,8 +0,0 @@
public class simpleClass {
protected static class Inner {
public Inner() {}
public String foo() {
return "OK";
}
}
}
@@ -1,9 +1,22 @@
class Derived(): simpleClass() {
// FILE: Base.java
public class Base {
protected static class Inner {
public Inner() {}
public String foo() {
return "OK";
}
}
}
// FILE: 1.kt
class Derived : Base() {
fun test(): String {
return simpleClass.Inner().foo()!!
return Base.Inner().foo()!!
}
}
fun box(): String {
return Derived().test()
return Derived().test()
}
@@ -1,12 +0,0 @@
public class simpleClass2 {
public static class A {
protected static class B {
public B() {
}
public String foo() {
return "OK";
}
}
}
}
@@ -1,9 +1,26 @@
class Derived(): simpleClass2.A() {
// FILE: Base.java
public class Base {
public static class A {
protected static class B {
public B() {
}
public String foo() {
return "OK";
}
}
}
}
// FILE: 1.kt
class Derived : Base.A() {
fun test(): String {
return simpleClass2.A.B().foo()!!
return Base.A.B().foo()!!
}
}
fun box(): String {
return Derived().test()
return Derived().test()
}
@@ -1,5 +0,0 @@
public class simpleFun {
protected static String protectedFun() {
return "OK";
}
}
@@ -1,9 +1,19 @@
class Derived(): simpleFun() {
// FILE: Base.java
public class Base {
protected static String protectedFun() {
return "OK";
}
}
// FILE: 1.kt
class Derived : Base() {
fun test(): String {
return simpleFun.protectedFun()!!
return Base.protectedFun()!!
}
}
fun box(): String {
return Derived().test()
return Derived().test()
}
@@ -1,3 +0,0 @@
public class simpleProperty {
protected static final String protectedProperty = "OK";
}
@@ -1,10 +1,17 @@
class Derived(): simpleProperty() {
// FILE: Base.java
public class Base {
protected static final String protectedProperty = "OK";
}
// FILE: 1.kt
class Derived : Base() {
fun test(): String {
return simpleProperty.protectedProperty!!
return Base.protectedProperty!!
}
}
fun box(): String {
return Derived().test()
return Derived().test()
}