diff --git a/idea/tests/org/jetbrains/kotlin/asJava/KtLightAnnotationTest.kt b/idea/tests/org/jetbrains/kotlin/asJava/KtLightAnnotationTest.kt index 39e59113e53..c5b41db5bfe 100644 --- a/idea/tests/org/jetbrains/kotlin/asJava/KtLightAnnotationTest.kt +++ b/idea/tests/org/jetbrains/kotlin/asJava/KtLightAnnotationTest.kt @@ -554,6 +554,24 @@ class KtLightAnnotationTest : KotlinLightCodeInsightFixtureTestCase() { } + fun testJavaKeywordsInName() { + myFixture.configureByText( + "AnnotatedClass.kt", """ + package my.public.place + + annotation class Anno1(val import: String) + + @Anno1(import = "full") + class AnnotatedClass + """.trimIndent() + ) + + val annotations = myFixture.findClass("my.public.place.AnnotatedClass").expectAnnotations(1) + val annotation = annotations.first() + TestCase.assertEquals("my.public.place.Anno1", annotation.qualifiedName) + assertTextAndRange("\"full\"", annotation.findAttributeValue("import")!!) + } + fun testWrongNamesPassed() { myFixture.configureByText("AnnotatedClass.kt", """ annotation class Anno1(val i:Int , val j: Int) diff --git a/idea/tests/org/jetbrains/kotlin/asJava/KtLightAnnotationTest.kt.173 b/idea/tests/org/jetbrains/kotlin/asJava/KtLightAnnotationTest.kt.173 index 21b1a031e45..25de982249c 100644 --- a/idea/tests/org/jetbrains/kotlin/asJava/KtLightAnnotationTest.kt.173 +++ b/idea/tests/org/jetbrains/kotlin/asJava/KtLightAnnotationTest.kt.173 @@ -555,6 +555,24 @@ class KtLightAnnotationTest : KotlinLightCodeInsightFixtureTestCase() { } + fun testJavaKeywordsInName() { + myFixture.configureByText( + "AnnotatedClass.kt", """ + package my.public.place + + annotation class Anno1(val import: String) + + @Anno1(import = "full") + class AnnotatedClass + """.trimIndent() + ) + + val annotations = myFixture.findClass("my.public.place.AnnotatedClass").expectAnnotations(1) + val annotation = annotations.first() + TestCase.assertEquals("my.public.place.Anno1", annotation.qualifiedName) + assertTextAndRange("\"full\"", annotation.findAttributeValue("import")!!) + } + fun testWrongNamesPassed() { myFixture.configureByText("AnnotatedClass.kt", """ annotation class Anno1(val i:Int , val j: Int)