mirror of
https://github.com/jlengrand/kotlin.git
synced 2026-05-11 00:21:29 +00:00
This patch mutes the following test categories:
* Tests with java dependencies (System class,
java stdlib, jvm-oriented annotations etc).
* Coroutines tests.
* Reflection tests.
* Tests with an inheritance from the standard
collections.
33 lines
703 B
Kotlin
Vendored
33 lines
703 B
Kotlin
Vendored
// TODO: muted automatically, investigate should it be ran for JS or not
|
|
// IGNORE_BACKEND: JS, NATIVE
|
|
|
|
// WITH_REFLECT
|
|
|
|
import kotlin.reflect.*
|
|
import kotlin.reflect.jvm.*
|
|
|
|
class K {
|
|
fun foo(s: String): Int = s.length
|
|
}
|
|
fun bar(s: String): Int = s.length
|
|
fun String.baz(): Int = this.length
|
|
|
|
fun check(f: KFunction<Int>) {
|
|
assert(f.javaConstructor == null) { "Fail f constructor" }
|
|
assert(f.javaMethod != null) { "Fail f method" }
|
|
val m = f.javaMethod!!
|
|
|
|
assert(m.kotlinFunction != null) { "Fail m function" }
|
|
val ff = m.kotlinFunction!!
|
|
|
|
assert(f == ff) { "Fail f != ff" }
|
|
}
|
|
|
|
fun box(): String {
|
|
check(K::foo)
|
|
check(::bar)
|
|
check(String::baz)
|
|
|
|
return "OK"
|
|
}
|