Migrate boxWithJava tests to multi-file framework
This commit is contained in:
+16
@@ -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) {
|
||||
-11
@@ -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();
|
||||
}
|
||||
}
|
||||
+19
@@ -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") {}
|
||||
-14
@@ -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);
|
||||
}
|
||||
}
|
||||
+10
@@ -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) {
|
||||
-5
@@ -1,5 +0,0 @@
|
||||
public class WithVarargs {
|
||||
public static String foo() {
|
||||
return new A("1", "2", "3").getProp();
|
||||
}
|
||||
}
|
||||
+16
@@ -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
|
||||
Vendored
-11
@@ -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);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user