Merge boxWithStdlib testData into box, delete BoxWithStdlib test

This commit is contained in:
Alexander Udalov
2016-03-07 13:36:14 +03:00
committed by Alexander Udalov
parent 22bfc9786a
commit 06a67e6602
535 changed files with 3520 additions and 3871 deletions
@@ -0,0 +1,34 @@
// WITH_RUNTIME
import kotlin.test.assertEquals
open class A<T1, T2, T3>
inline fun <reified T, reified R> foo(): Array<A<*,*,*>> {
val x = object {
inline fun <reified T1, reified T> bar(): A<*,*,*> = object : A<T1,T,R>() {}
fun f1() = bar<T, R>()
fun f2() = bar<R, T>()
fun f3() = bar<Boolean, T>()
fun f4() = bar<T, Boolean>()
}
return arrayOf(x.f1(), x.f2(), x.f3(), x.f4())
}
fun box(): String {
val result = foo<Double, Int>()
val expected = arrayOf(
Triple("java.lang.Double", "java.lang.Integer", "java.lang.Integer"),
Triple("java.lang.Integer", "java.lang.Double", "java.lang.Integer"),
Triple("java.lang.Boolean", "java.lang.Double", "java.lang.Integer"),
Triple("java.lang.Double", "java.lang.Boolean", "java.lang.Integer")
).map { "A<${it.first}, ${it.second}, ${it.third}>" }
for (i in expected.indices) {
assertEquals(expected[i], result[i].javaClass.getGenericSuperclass()?.toString(), "$i-th element")
}
return "OK"
}