KtLightAnnotationTest fix for oddly broken annotations getter
This commit is contained in:
committed by
Pavel Talanov
parent
be4b86e3d9
commit
29857e48c8
@@ -240,13 +240,7 @@ class KtLightAnnotationTest : KotlinLightCodeInsightFixtureTestCase() {
|
|||||||
class MyAnnotated {}
|
class MyAnnotated {}
|
||||||
""".trimIndent())
|
""".trimIndent())
|
||||||
|
|
||||||
val annotations = listOf(myFixture.findClass("MyAnnotated")).let {
|
val annotations = myFixture.findClass("MyAnnotated").expectAnnotations(1)
|
||||||
assertEquals(1, it.size)
|
|
||||||
it.first().annotations.apply {
|
|
||||||
assertEquals(1, it.size)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
annotations[0].let { annotation ->
|
annotations[0].let { annotation ->
|
||||||
val annotationAttributeVal = annotation.findAttributeValue("value") as PsiElement
|
val annotationAttributeVal = annotation.findAttributeValue("value") as PsiElement
|
||||||
assertTextAndRange("@Outer(Inner())", annotationAttributeVal)
|
assertTextAndRange("@Outer(Inner())", annotationAttributeVal)
|
||||||
@@ -377,7 +371,7 @@ class KtLightAnnotationTest : KotlinLightCodeInsightFixtureTestCase() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private fun PsiModifierListOwner.expectAnnotations(number: Int): Array<PsiAnnotation> =
|
private fun PsiModifierListOwner.expectAnnotations(number: Int): Array<PsiAnnotation> =
|
||||||
this.annotations.apply {
|
this.modifierList!!.annotations.apply {
|
||||||
TestCase.assertEquals("expected one annotation, found ${this.joinToString(", ") { it.qualifiedName ?: "unknown" }}",
|
TestCase.assertEquals("expected one annotation, found ${this.joinToString(", ") { it.qualifiedName ?: "unknown" }}",
|
||||||
number, size)
|
number, size)
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user