Migrate boxWithJava tests to multi-file framework
This commit is contained in:
@@ -0,0 +1,16 @@
|
||||
// FILE: JFun.java
|
||||
|
||||
class JFun implements kotlin.jvm.functions.Function0<String> {
|
||||
public String invoke() {
|
||||
return "OK";
|
||||
}
|
||||
}
|
||||
|
||||
// FILE: test.kt
|
||||
|
||||
fun box(): String {
|
||||
val jfun = JFun()
|
||||
val jf = jfun as Any
|
||||
if (jf is Function0<*>) return jfun()
|
||||
else return "Failed: jf is Function0<*>"
|
||||
}
|
||||
@@ -1,5 +0,0 @@
|
||||
class JFun implements kotlin.jvm.functions.Function0<String> {
|
||||
public String invoke() {
|
||||
return "OK";
|
||||
}
|
||||
}
|
||||
@@ -1,6 +0,0 @@
|
||||
fun box(): String {
|
||||
val jfun = JFun()
|
||||
val jf = jfun as Any
|
||||
if (jf is Function0<*>) return jfun()
|
||||
else return "Failed: jf is Function0<*>"
|
||||
}
|
||||
+10
-1
@@ -1,3 +1,5 @@
|
||||
// FILE: Box.java
|
||||
|
||||
public class Box<T> {
|
||||
private final T value;
|
||||
|
||||
@@ -12,4 +14,11 @@ public class Box<T> {
|
||||
public T getValue() {
|
||||
return value;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// FILE: test.kt
|
||||
|
||||
fun box(): String {
|
||||
val sub = Box<Long>(-1)
|
||||
return if (sub.value == -1L) "OK" else "fail"
|
||||
}
|
||||
-4
@@ -1,4 +0,0 @@
|
||||
fun box(): String {
|
||||
val sub = Box<Long>(-1)
|
||||
return if (sub.value == -1L) "OK" else "fail"
|
||||
}
|
||||
Reference in New Issue
Block a user