mirror of
https://github.com/jlengrand/kotlin.git
synced 2026-05-08 15:53:19 +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.
36 lines
936 B
Kotlin
Vendored
36 lines
936 B
Kotlin
Vendored
// TODO: muted automatically, investigate should it be ran for JS or not
|
|
// IGNORE_BACKEND: JS, NATIVE
|
|
|
|
// WITH_RUNTIME
|
|
|
|
enum class IssueState {
|
|
DEFAULT,
|
|
FIXED {
|
|
override fun ToString() = "K"
|
|
};
|
|
|
|
open fun ToString(): String = "O"
|
|
}
|
|
|
|
fun box(): String {
|
|
val field = IssueState::class.java.getField("FIXED")
|
|
|
|
val typeName = field.type.name
|
|
if (typeName != "IssueState") return "Fail type name: $typeName"
|
|
|
|
val className = field.get(null).javaClass.name
|
|
if (className != "IssueState\$FIXED") return "Fail class name: $className"
|
|
|
|
val classLoader = IssueState::class.java.classLoader
|
|
classLoader.loadClass("IssueState\$FIXED")
|
|
try {
|
|
classLoader.loadClass("IssueState\$DEFAULT")
|
|
return "Fail: no class should have been generated for DEFAULT"
|
|
}
|
|
catch (e: Exception) {
|
|
// ok
|
|
}
|
|
|
|
return IssueState.DEFAULT.ToString() + IssueState.FIXED.ToString()
|
|
}
|