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:
28
compiler/testData/codegen/boxWithJava/reflection/annotationsOnJavaMembers.kt
vendored
Normal file
28
compiler/testData/codegen/boxWithJava/reflection/annotationsOnJavaMembers.kt
vendored
Normal file
@@ -0,0 +1,28 @@
|
||||
// FILE: J.java
|
||||
|
||||
@Anno("J")
|
||||
public class J {
|
||||
@Anno("foo")
|
||||
public static int foo = 42;
|
||||
|
||||
@Anno("bar")
|
||||
public static void bar() {}
|
||||
|
||||
@Anno("constructor")
|
||||
public J() {}
|
||||
}
|
||||
|
||||
// FILE: K.kt
|
||||
|
||||
import kotlin.test.assertEquals
|
||||
|
||||
annotation class Anno(val value: String)
|
||||
|
||||
fun box(): String {
|
||||
assertEquals("[@Anno(value=J)]", J::class.annotations.toString())
|
||||
assertEquals("[@Anno(value=foo)]", J::foo.annotations.toString())
|
||||
assertEquals("[@Anno(value=bar)]", J::bar.annotations.toString())
|
||||
assertEquals("[@Anno(value=constructor)]", ::J.annotations.toString())
|
||||
|
||||
return "OK"
|
||||
}
|
||||
Reference in New Issue
Block a user