mirror of
https://github.com/jlengrand/kotlin.git
synced 2026-05-10 00:21:35 +00:00
Migrate boxWithJava tests to multi-file framework
This commit is contained in:
27
compiler/testData/codegen/boxWithJava/reflection/javaClassGetFunctions.kt
vendored
Normal file
27
compiler/testData/codegen/boxWithJava/reflection/javaClassGetFunctions.kt
vendored
Normal file
@@ -0,0 +1,27 @@
|
||||
// FILE: J.java
|
||||
|
||||
public class J {
|
||||
public J() {
|
||||
}
|
||||
|
||||
public void member(String s) {
|
||||
}
|
||||
|
||||
public static void staticMethod(int x) {
|
||||
}
|
||||
}
|
||||
|
||||
// FILE: K.kt
|
||||
|
||||
import kotlin.reflect.*
|
||||
import kotlin.test.assertEquals
|
||||
|
||||
fun box(): String {
|
||||
assertEquals(listOf("equals", "hashCode", "member", "staticMethod", "toString"), J::class.members.map { it.name }.sorted())
|
||||
assertEquals(listOf("equals", "hashCode", "member", "staticMethod", "toString"), J::class.functions.map { it.name }.sorted())
|
||||
assertEquals(listOf("member", "staticMethod"), J::class.declaredFunctions.map { it.name }.sorted())
|
||||
|
||||
assertEquals(1, J::class.constructors.size)
|
||||
|
||||
return "OK"
|
||||
}
|
||||
Reference in New Issue
Block a user