Add tests for repeatable annotations on expect-actual declarations

Add tests showing current behavior.

^KT-60670
This commit is contained in:
Roman Efremov
2023-08-01 12:59:45 +02:00
committed by Space Team
parent 2de9480101
commit 5ed3f308fa
6 changed files with 139 additions and 0 deletions
@@ -292,6 +292,18 @@ public class FirOldFrontendMPPDiagnosticsWithLightTreeTestGenerated extends Abst
runTest("compiler/testData/diagnostics/tests/multiplatform/annotationMatching/kotlinAnaloguesForJavaAnnotations.kt");
}
@Test
@TestMetadata("repeatableNoArg.kt")
public void testRepeatableNoArg() throws Exception {
runTest("compiler/testData/diagnostics/tests/multiplatform/annotationMatching/repeatableNoArg.kt");
}
@Test
@TestMetadata("repeatableWithArg.kt")
public void testRepeatableWithArg() throws Exception {
runTest("compiler/testData/diagnostics/tests/multiplatform/annotationMatching/repeatableWithArg.kt");
}
@Test
@TestMetadata("skippedAnnotations.kt")
public void testSkippedAnnotations() throws Exception {
@@ -292,6 +292,18 @@ public class FirOldFrontendMPPDiagnosticsWithPsiTestGenerated extends AbstractFi
runTest("compiler/testData/diagnostics/tests/multiplatform/annotationMatching/kotlinAnaloguesForJavaAnnotations.kt");
}
@Test
@TestMetadata("repeatableNoArg.kt")
public void testRepeatableNoArg() throws Exception {
runTest("compiler/testData/diagnostics/tests/multiplatform/annotationMatching/repeatableNoArg.kt");
}
@Test
@TestMetadata("repeatableWithArg.kt")
public void testRepeatableWithArg() throws Exception {
runTest("compiler/testData/diagnostics/tests/multiplatform/annotationMatching/repeatableWithArg.kt");
}
@Test
@TestMetadata("skippedAnnotations.kt")
public void testSkippedAnnotations() throws Exception {
@@ -0,0 +1,23 @@
// FIR_IDENTICAL
// WITH_STDLIB
// MODULE: m1-common
// FILE: common.kt
@Repeatable
annotation class AnnNoArg
@AnnNoArg
@AnnNoArg
expect fun oneMoreOnExpect()
@AnnNoArg
expect fun oneMoreOnActual()
// MODULE: m1-jvm()()(m1-common)
// FILE: jvm.kt
@AnnNoArg
actual fun oneMoreOnExpect() {}
@AnnNoArg
@AnnNoArg
actual fun oneMoreOnActual() {}
@@ -0,0 +1,40 @@
// WITH_STDLIB
// MODULE: m1-common
// FILE: common.kt
@Repeatable
annotation class AnnWithArg(val s: String)
@AnnWithArg(s = "1")
@AnnWithArg(s = "2")
expect fun diffentOrder()
@AnnWithArg(s = "1")
@AnnWithArg(s = "2")
@AnnWithArg(s = "3")
expect fun withDifferentArgLessOnActual()
@AnnWithArg(s = "1")
@AnnWithArg(s = "3")
expect fun withDifferentArgLessOnExpect()
@AnnWithArg(s = "1")
@AnnWithArg(s = "1")
expect fun withSameArgLessOnActual()
// MODULE: m1-jvm()()(m1-common)
// FILE: jvm.kt
@AnnWithArg(s = "1")
@AnnWithArg(s = "2")
actual fun diffentOrder() {}
<!ACTUAL_ANNOTATIONS_NOT_MATCH_EXPECT!>@AnnWithArg(s = "1")
@AnnWithArg(s = "3")
actual fun <!ACTUAL_ANNOTATIONS_NOT_MATCH_EXPECT!>withDifferentArgLessOnActual<!>() {}<!>
@AnnWithArg(s = "1")
@AnnWithArg(s = "2")
@AnnWithArg(s = "3")
actual fun withDifferentArgLessOnExpect() {}
@AnnWithArg(s = "1")
actual fun withSameArgLessOnActual() {}
@@ -0,0 +1,40 @@
// WITH_STDLIB
// MODULE: m1-common
// FILE: common.kt
@Repeatable
annotation class AnnWithArg(val s: String)
@AnnWithArg(s = "1")
@AnnWithArg(s = "2")
expect fun diffentOrder()
@AnnWithArg(s = "1")
@AnnWithArg(s = "2")
@AnnWithArg(s = "3")
expect fun withDifferentArgLessOnActual()
@AnnWithArg(s = "1")
@AnnWithArg(s = "3")
expect fun withDifferentArgLessOnExpect()
@AnnWithArg(s = "1")
@AnnWithArg(s = "1")
expect fun withSameArgLessOnActual()
// MODULE: m1-jvm()()(m1-common)
// FILE: jvm.kt
@AnnWithArg(s = "1")
@AnnWithArg(s = "2")
actual fun diffentOrder() {}
@AnnWithArg(s = "1")
@AnnWithArg(s = "3")
actual fun <!ACTUAL_ANNOTATIONS_NOT_MATCH_EXPECT!>withDifferentArgLessOnActual<!>() {}
@AnnWithArg(s = "1")
@AnnWithArg(s = "2")
@AnnWithArg(s = "3")
actual fun withDifferentArgLessOnExpect() {}
@AnnWithArg(s = "1")
actual fun withSameArgLessOnActual() {}
@@ -22935,6 +22935,18 @@ public class DiagnosticTestGenerated extends AbstractDiagnosticTest {
runTest("compiler/testData/diagnostics/tests/multiplatform/annotationMatching/kotlinAnaloguesForJavaAnnotations.kt");
}
@Test
@TestMetadata("repeatableNoArg.kt")
public void testRepeatableNoArg() throws Exception {
runTest("compiler/testData/diagnostics/tests/multiplatform/annotationMatching/repeatableNoArg.kt");
}
@Test
@TestMetadata("repeatableWithArg.kt")
public void testRepeatableWithArg() throws Exception {
runTest("compiler/testData/diagnostics/tests/multiplatform/annotationMatching/repeatableWithArg.kt");
}
@Test
@TestMetadata("skippedAnnotations.kt")
public void testSkippedAnnotations() throws Exception {