[Test] Convert IGNORE: NATIVE directives in box tests from A to C
^KT-59057 Merge-request: KT-MR-10747 Merged-by: Vladimir Sukharev <Vladimir.Sukharev@jetbrains.com>
This commit is contained in:
committed by
Space Team
parent
2da0e622c0
commit
3d60ed8874
Vendored
+30
@@ -0,0 +1,30 @@
|
||||
// DONT_TARGET_EXACT_BACKEND: JVM
|
||||
// DONT_TARGET_EXACT_BACKEND: JVM_IR
|
||||
|
||||
// WITH_STDLIB
|
||||
// WITH_REFLECT
|
||||
|
||||
import kotlin.test.assertEquals
|
||||
|
||||
fun <T, R> foo(x: T): R = TODO()
|
||||
fun <T> fooReturnInt(x: T): Int = 1
|
||||
|
||||
inline fun <reified T, reified R> check(x: T, y: R, f: (T) -> R, tType: String, rType: String) {
|
||||
assertEquals(tType, T::class.simpleName)
|
||||
assertEquals(rType, R::class.simpleName)
|
||||
}
|
||||
|
||||
inline fun <reified T, reified R> check(f: (T) -> R, g: (T) -> R, tType: String, rType: String) {
|
||||
assertEquals(tType, T::class.simpleName)
|
||||
assertEquals(rType, R::class.simpleName)
|
||||
}
|
||||
|
||||
fun box(): String {
|
||||
check("", 1, ::foo, "String", "Int")
|
||||
check("", 1, ::fooReturnInt, "String", "Int")
|
||||
check("", "", ::fooReturnInt, "String", "Comparable") // KT-59348 JVM backends have not "Comparable", but "Any" as common parent for Int and String
|
||||
|
||||
check(Int::toString, ::foo, "Int", "String")
|
||||
|
||||
return "OK"
|
||||
}
|
||||
Reference in New Issue
Block a user