[Test] Merge box against java testdata into codegen black box testsdata

This commit is contained in:
Dmitriy Novozhilov
2021-01-27 16:21:31 +03:00
parent e62b118351
commit 3199ce03a6
165 changed files with 0 additions and 3948 deletions
+44
View File
@@ -0,0 +1,44 @@
// DONT_TARGET_EXACT_BACKEND: JS JS_IR JS_IR_ES6 WASM NATIVE
// IGNORE_BACKEND_FIR: JVM_IR
// SKIP_JDK6
// MODULE: lib
// FILE: Custom.java
class Custom<K, V> {
private K k;
private V v;
public Custom(K k, V v) {
this.k = k;
this.v = v;
}
public interface MBiConsumer<T, U> {
void accept(T t, U u);
}
public void forEach(MBiConsumer<? super K, ? super V> action) {
action.accept(k, v);
}
}
// MODULE: main(lib)
// FILE: 1.kt
import java.util.Arrays
fun box(): String {
val instance = Custom<String, String>("O", "K")
var result = "fail"
instance.forEach { a, b ->
result = a + b
}
val superInterfaces = Arrays.toString((Class.forName("_1Kt\$box$1")).genericInterfaces)
if (superInterfaces != "[Custom\$MBiConsumer<java.lang.String, java.lang.String>]") {
return "fail: $superInterfaces"
}
return result
}