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
@@ -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<*>"
}
@@ -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"
}
@@ -1,4 +0,0 @@
fun box(): String {
val sub = Box<Long>(-1)
return if (sub.value == -1L) "OK" else "fail"
}