Migrate boxWithJava tests to multi-file framework

This commit is contained in:
Alexander Udalov
2016-03-01 19:18:37 +03:00
parent 0801ae5364
commit 2de7f38427
266 changed files with 2271 additions and 1729 deletions
@@ -1,3 +1,19 @@
// FILE: WithGenerics.java
class WithGenerics {
public static String foo1() {
A<Double> x = new A<Double>("OK");
return x.toString();
}
public static String foo2() {
A<Integer> x = new A<Integer>(123);
return x.toString();
}
}
// FILE: WithGenerics.kt
open class A<T> {
val prop: String
constructor(x: String) {
@@ -1,11 +0,0 @@
class WithGenerics {
public static String foo1() {
A<Double> x = new A<Double>("OK");
return x.toString();
}
public static String foo2() {
A<Integer> x = new A<Integer>(123);
return x.toString();
}
}
@@ -1,3 +1,22 @@
// FILE: WithPrimary.java
class WithPrimary {
public static A test1() {
return new A("123", "abc");
}
public static A test2() {
return new A();
}
public static A test3() {
return new A("123", 456);
}
public static A test4() {
return new A(1.0);
}
}
// FILE: WithPrimary.kt
class A(val x: String = "def_x", val y: String = "1") {
constructor(x: String, y: Int): this(x, y.toString()) {}
constructor(x: Double): this(x.toString(), "def_y") {}
@@ -1,14 +0,0 @@
class WithPrimary {
public static A test1() {
return new A("123", "abc");
}
public static A test2() {
return new A();
}
public static A test3() {
return new A("123", 456);
}
public static A test4() {
return new A(1.0);
}
}
@@ -1,3 +1,13 @@
// FILE: WithVarargs.java
public class WithVarargs {
public static String foo() {
return new A("1", "2", "3").getProp();
}
}
// FILE: withVarargs.kt
fun join(x: Array<out String>): String {
var result = ""
for (i in x) {
@@ -1,5 +0,0 @@
public class WithVarargs {
public static String foo() {
return new A("1", "2", "3").getProp();
}
}
@@ -1,3 +1,19 @@
// FILE: WithoutPrimary.java
class WithoutPrimary {
public static A test1() {
return new A("123", "abc");
}
public static A test3() {
return new A("123", 456);
}
public static A test4() {
return new A(1.0);
}
}
// FILE: WithoutPrimary.kt
class A {
val x: String
val y: String
@@ -1,11 +0,0 @@
class WithoutPrimary {
public static A test1() {
return new A("123", "abc");
}
public static A test3() {
return new A("123", 456);
}
public static A test4() {
return new A(1.0);
}
}