[Tests] Refactor: move annotation arguments lazy resolve test for

...`ACTUAL_ANNOTATIONS_NOT_MATCH_EXPECT` checker near to
other tests of this diagnostic. This is because now such tests
are run in lazy resolve test suite, so no need to store them
separately.

^KT-62559
This commit is contained in:
Roman Efremov
2023-11-10 12:13:17 +01:00
committed by Space Team
parent c20a5fc650
commit 99bf96e747
10 changed files with 64 additions and 32 deletions
@@ -0,0 +1,34 @@
// Test for ACTUAL_ANNOTATIONS_NOT_MATCH_EXPECT diagnostic when annotations arguments are lazily resolved.
// MODULE: common
// TARGET_PLATFORM: Common
@Target(AnnotationTarget.TYPE, AnnotationTarget.FUNCTION)
annotation class Ann(val s: String = "default")
expect fun onType_negative(): @Ann("") Any
expect fun onType_positive(): @Ann("") Any
@Ann("")
expect fun onFunction_negative()
@Ann("")
expect fun onFunction_positive()
@Ann
expect fun withEmptyArguments_negative()
@Ann
expect fun withEmptyArguments_positive()
// MODULE: main()()(common)
// TARGET_PLATFORM: JVM
actual fun onType_negative(): @Ann("") Any = Any()
<!ACTUAL_ANNOTATIONS_NOT_MATCH_EXPECT!>actual fun <!ACTUAL_ANNOTATIONS_NOT_MATCH_EXPECT!>onType_positive<!>(): @Ann("incorrect") Any = Any()<!>
@Ann("")
actual fun onFunction_negative() {}
<!ACTUAL_ANNOTATIONS_NOT_MATCH_EXPECT!>@Ann("incorrect")
actual fun <!ACTUAL_ANNOTATIONS_NOT_MATCH_EXPECT!>onFunction_positive<!>() {}<!>
@Ann
actual fun withEmptyArguments_negative() {}
<!ACTUAL_ANNOTATIONS_NOT_MATCH_EXPECT!>@Ann("incorrect")
actual fun <!ACTUAL_ANNOTATIONS_NOT_MATCH_EXPECT!>withEmptyArguments_positive<!>() {}<!>
@@ -0,0 +1,34 @@
// Test for ACTUAL_ANNOTATIONS_NOT_MATCH_EXPECT diagnostic when annotations arguments are lazily resolved.
// MODULE: common
// TARGET_PLATFORM: Common
@Target(AnnotationTarget.TYPE, AnnotationTarget.FUNCTION)
annotation class Ann(val s: String = "default")
expect fun onType_negative(): @Ann("") Any
expect fun onType_positive(): @Ann("") Any
@Ann("")
expect fun onFunction_negative()
@Ann("")
expect fun onFunction_positive()
@Ann
expect fun withEmptyArguments_negative()
@Ann
expect fun withEmptyArguments_positive()
// MODULE: main()()(common)
// TARGET_PLATFORM: JVM
actual fun onType_negative(): @Ann("") Any = Any()
actual fun onType_positive(): @Ann("incorrect") Any = Any()
@Ann("")
actual fun onFunction_negative() {}
@Ann("incorrect")
actual fun <!ACTUAL_ANNOTATIONS_NOT_MATCH_EXPECT!>onFunction_positive<!>() {}
@Ann
actual fun withEmptyArguments_negative() {}
@Ann("incorrect")
actual fun <!ACTUAL_ANNOTATIONS_NOT_MATCH_EXPECT!>withEmptyArguments_positive<!>() {}
@@ -0,0 +1,34 @@
// Test for ACTUAL_ANNOTATIONS_NOT_MATCH_EXPECT diagnostic when annotations arguments are lazily resolved.
// MODULE: common
// TARGET_PLATFORM: Common
@Target(AnnotationTarget.TYPE, AnnotationTarget.FUNCTION)
annotation class Ann(val s: String = "default")
expect fun onType_negative(): @Ann("") Any
expect fun onType_positive(): @Ann("") Any
@Ann("")
expect fun onFunction_negative()
@Ann("")
expect fun onFunction_positive()
@Ann
expect fun withEmptyArguments_negative()
@Ann
expect fun withEmptyArguments_positive()
// MODULE: main()()(common)
// TARGET_PLATFORM: JVM
actual fun onType_negative(): @Ann("") Any = Any()
actual fun <!ACTUAL_ANNOTATIONS_NOT_MATCH_EXPECT!>onType_positive<!>(): @Ann("incorrect") Any = Any()
@Ann("")
actual fun onFunction_negative() {}
@Ann("incorrect")
actual fun <!ACTUAL_ANNOTATIONS_NOT_MATCH_EXPECT!>onFunction_positive<!>() {}
@Ann
actual fun withEmptyArguments_negative() {}
@Ann("incorrect")
actual fun <!ACTUAL_ANNOTATIONS_NOT_MATCH_EXPECT!>withEmptyArguments_positive<!>() {}