KotlinAndJavaCheckerTest: Add test for annotating java code with kotlin annotations
This commit is contained in:
@@ -0,0 +1,27 @@
|
|||||||
|
class KotlinAnnotations {
|
||||||
|
|
||||||
|
@<error descr="'d' missing though required">k.Anno1</error>()
|
||||||
|
@<error descr="'c', 'g' missing though required">k.Anno2</error>()
|
||||||
|
public static void m1() {
|
||||||
|
}
|
||||||
|
|
||||||
|
@<error descr="'d' missing though required">k.Anno1</error>(c = 3)
|
||||||
|
@<error descr="'g' missing though required">k.Anno2</error>(c = 3)
|
||||||
|
public static void m2() {
|
||||||
|
}
|
||||||
|
|
||||||
|
@k.Anno1(d = 5)
|
||||||
|
@<error descr="'c' missing though required">k.Anno2</error>(g = "asdas")
|
||||||
|
public static void m3() {
|
||||||
|
}
|
||||||
|
|
||||||
|
@k.Anno1(c = 1, d = 5)
|
||||||
|
@k.Anno2(c = {6, 5}, g = "asdas")
|
||||||
|
public static void m4() {
|
||||||
|
}
|
||||||
|
|
||||||
|
@k.Anno1(<error descr="Cannot resolve method 'x'">x</error> = 1)
|
||||||
|
@k.Anno2(<error descr="Cannot resolve method 'x'">x</error> = 2)
|
||||||
|
public static void m5() {
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,4 @@
|
|||||||
|
package k
|
||||||
|
|
||||||
|
annotation class Anno1(val d: Int, val c: Int = 2)
|
||||||
|
annotation class Anno2(val c: IntArray, val g: String)
|
||||||
@@ -166,6 +166,10 @@ public class KotlinAndJavaCheckerTest extends KotlinDaemonAnalyzerTestCase {
|
|||||||
doTest();
|
doTest();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void testKotlinAnnotations() throws Exception {
|
||||||
|
doTest();
|
||||||
|
}
|
||||||
|
|
||||||
public void doTest() throws Exception {
|
public void doTest() throws Exception {
|
||||||
doTest(true, true, getTestName(false) + ".java", getTestName(false) + ".kt");
|
doTest(true, true, getTestName(false) + ".java", getTestName(false) + ".kt");
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user